tree-sitter-nix-js-template
v1.1.0
Published
Tree-sitter grammar for Nix.js html`` and raw(``) templates
Maintainers
Readme
tree-sitter-nix-js-template
Tree-sitter grammar for Nix.js html\`` tagged templates.
Provides syntax highlighting and structural parsing of Nix.js HTML tagged template literals in any editor that supports Tree-sitter: Neovim, Helix, Zed, Emacs, GitHub code viewer.
Parses elements, attributes (including @event.modifier bindings, ref/show/hide
directives) and ${...} substitutions inside quoted and unquoted attribute values
(partial attribute interpolation, core ≥ 3.3).
Install
npm install tree-sitter-nix-js-templateEditor setup
Neovim (nvim-treesitter)
-- Add to your nvim-treesitter config
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.nix_js_template = {
install_info = {
url = "https://github.com/DeijoseDevelop/tree-sitter-nix-js-template",
files = { "src/parser.c" },
},
filetype = "typescript",
}Helix
# ~/.config/helix/languages.toml
[[grammar]]
name = "nix_js_template"
source = { git = "https://github.com/DeijoseDevelop/tree-sitter-nix-js-template", rev = "main" }Zed
Add to settings.json or publish to the Zed extension registry.
Development
npm install
npm run generate # generate parser from grammar.js
npm test # run corpus testsLicense
MIT
