ngalaiko / tree-sitter-go-template

Golang template grammar for tree-sitter
MIT License
74 stars 27 forks source link
go parser template tree-sitter

Announcement

The original author stopped using helm (which he mostly wrote this package for) on a daily basis, so he didn't really keep up with the development of tree sitter, and nvim-tree-sitter. Some people have been found to keep the repo going, so if you have ideas for improvements feel free to open issues or pull requests.

tree-sitter-go-template

Build/test

Golang templates grammar for tree-sitter.

Also includes a helm dialect. The concept of a dialect is that it uses the same parser, but can have different queries (e.g. for different injections). More dialects could be added in the future (e.g. for html templates).

NeoVim integration using nvim-treesitter

:TSInstall gotmpl
:TSInstall helm

[!NOTE]

If you are using helm, you should also install the yaml parser (:TSInstall yaml) to get language injection for yaml

[!TIP]

If you are using AstroNvim you can just install the astrocommunity helm pack.