Open florentsorel opened 5 months ago
I also have similar issue,
LSP detects the .tmpl file as gotexttmpl
instead of gohtmltmpl
.
I have to manually set the filetype to gohtmltmpl
everytime.
Is there anyway to auto detect my html template as gohtmltmpl
?
I find a solution. Try to create .gohtml
file and this extension is set to gohtmltmpl
filetype.
Works for me.
I find a solution. Try to create
.gohtml
file and this extension is set togohtmltmpl
filetype. Works for me.
it works, thanks for your advice. i am wondering is there any way to detect the correct file type without changing the file extension.
A good reference on setting with treesitter is here: https://github.com/ngalaiko/tree-sitter-go-template?tab=readme-ov-file
@ray-x Where did you read that Neovim is deprecating non-treesitter based syntax highlighting? I can't seem to find any information on it :/
(This seemed like the right place to ask as 05ba8a9 references this issue)
Please check this comment.
https://github.com/nvim-treesitter/nvim-treesitter/issues/2846#issuecomment-1104790065
That comment doesn't indicate a deprecation of the Vim syntax engine (I did also confirm in the Neovim matrix chat that no deprecation is planned) - or even a change of any particular feature that would impact the Vim syntax engine.
Are you referring to the Vim syntax engine being referred to as "legacy"? In my experience, "legacy" may mean "superseded" (there is a better option where applicable), but does not itself imply that the system is deprecated. Particularly in the case of Neovim, such a large deprecation would want for an extremely prominent and official notice, and would - going by the API contract - probably not be actually removed until 2 major versions from now (v2).
It seems unlikely that Neovim would deprecate the Vim syntax engine any time in the forseeable future, as there are still several if not many commonly used languages that do not have treesitter parsers, some of which are not representable with CFGs.
I try to have .tmpl file working but nothing work. I've read this PR but it doesn't work for me.
.tmpl file![image](https://github.com/ray-x/go.nvim/assets/1011503/d9268f48-04bd-47eb-8f69-c5b892e563ea)
.html file![image](https://github.com/ray-x/go.nvim/assets/1011503/89a68260-5a2c-4348-b2e2-1cbcca0a6716)