-
I want to edit .templ files in Helix for my Go server: https://github.com/a-h/templ I've gotten as far as successfully adding the language and grammar: [[language]]
name = "templ"
auto-format = true
scope = "source.templ"
injection-regex = "templ"
grammar = "templ"
file-types = ["templ"]
roots = ["go.sum"]
comment-token = "//"
indent = { tab-width = 4, unit = "\t" }
language-server = { command = "templ", args = ["lsp"] }
formatter = { command = "templ" , args = ["fmt"] }
[[grammar]]
name = "templ"
source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "6ab863186d1ba91718125f59deae6cf68d765fcb" } The tree-sitter grammar appears to have support for highlights: https://github.com/vrischmann/tree-sitter-templ/tree/master/queries But after running
Any ideas what I might be missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You need to also write highlight queries: https://docs.helix-editor.com/guides/adding_languages.html#queries It won't work if the queries are just in the grammar folder -- they have to be in |
Beta Was this translation helpful? Give feedback.
-
@Teajey, Can you please guide me in getting this setup? Like the folder structure and files added, or perhaps share your Dotfile repo? |
Beta Was this translation helpful? Give feedback.
You need to also write highlight queries: https://docs.helix-editor.com/guides/adding_languages.html#queries
It won't work if the queries are just in the grammar folder -- they have to be in
runtime/queries