Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Updates documentation to help users enable HTML (and similar) language injection/highlighting when working with Go templates, with specific instructions for both NeoVim and Helix.
Changes:
- Clarifies that users must add an injections query to get templated-language highlighting (e.g., HTML).
- Adds editor-specific paths for NeoVim vs Helix query overrides.
- Expands guidance around configuring filetype detection.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`. | ||
|
|
There was a problem hiding this comment.
The instruction to install the injected language via :TSInstall is NeoVim-specific, but this section now also gives Helix instructions. Helix doesn't support :TSInstall, so this should be clarified/split (e.g., separate install guidance for NeoVim vs Helix) to avoid confusing Helix users.
| Replace html with the tree-sitter name of your required language and make sure to install it with `:TSInstall`. | ||
| Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`. | ||
|
|
||
| Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work. |
There was a problem hiding this comment.
This sentence is unclear/likely incorrect: ft=gotmpl applies to Go template files, not "html" in general, and Helix language detection typically depends on its language config. Consider rewording to explicitly mention Go-template filetypes/extensions supported by this repo (tree-sitter.json lists gotmpl/gotexttmpl/gohtmltmpl) and how to map common extensions (e.g. .gohtml) in NeoVim/Helix.
| Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work. | |
| Then ensure filetype detection is working: in NeoVim, map your Go template files (for example `*.gotmpl`, `*.gotexttmpl`, `*.gohtml`) to `ft=gotmpl`; in Helix, configure these extensions to use the `gotmpl` language (the default `.gotmpl` association should already work). |
| Replace html with the tree-sitter name of your required language and make sure to install it with `:TSInstall`. | ||
| Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`. | ||
|
|
||
| Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work. |
There was a problem hiding this comment.
Minor typo: "fileextension" should be "file extension".
| Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work. | |
| Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the file extension .gotmpl should work. |
|
|
||
| For NeoVim edit `~/.config/nvim/queries/gotmpl/injections.scm`. | ||
| For Helix edit `~/.config/helix/runtime/queries/gotmpl/injections.scm`. | ||
|
|
There was a problem hiding this comment.
This is the related Neovim Doc, might be a useful link to add in?: https://neovim.io/doc/user/treesitter/#treesitter-query-modeline-extends
fixes #48