feat: use custom Nix highlight queries for richer syntax colors

- queries/nix-highlights.scm: Adapted from Helix editor queries.
  Properly identifies functions, properties, variable parameters,
  escape sequences, and string interpolation. Much richer than
  the bundled tree-sitter-nix query (99 lines vs 113 lines).

- src/highlight.rs: Load custom Nix query via include_str!
  instead of using bundled HIGHLIGHTS_QUERY.

- static/style.css: Fix variable (#e36209) and punctuation (#586069)
  colors to be distinct from text color.

Results: hl-function now appears (6 occurrences), hl-property
visible (17), hl-variable reduced from 43 to 17. Functions like
mkShell now render in purple/blue instead of orange.
This commit is contained in:
Timothy DeHerrera
2026-01-25 20:18:48 -07:00
parent 5b7805d753
commit b16246fba6
3 changed files with 138 additions and 5 deletions

View File

@@ -145,7 +145,7 @@ fn get_config(lang: Language) -> HighlightConfiguration {
Language::Nix => (
tree_sitter_nix::LANGUAGE.into(),
"nix",
tree_sitter_nix::HIGHLIGHTS_QUERY,
include_str!("../queries/nix-highlights.scm"),
),
Language::Python => (
tree_sitter_python::LANGUAGE.into(),