Closed Ask-786 closed 5 months ago
How does that work? Does it mark the file as html
essentially, with angular
being a subset or something?
I think it does something like that. when we set filetype as angular
, basic functionalities like jumping between opening and closing tags with %
doesn't work. That's why i searched for another way. and also it's a pain to write configuration everywhere just for one specific thing.
Even if it doesn't work that way, I think we should try to make it work that way.
May be we can refer to the previous angular treesitter plugin nvim-treesitter-angular. this one was working fine out of the box.
The old plugin was injecting the parser on parts of the HTML file. That does not work with the control flow syntax of Angular. (@if (something) { }
is not valid HTML and throws errors in the HTML parser). Which is why I rebuilt the plugin, but now the Angular parser is extending the HTML one.
I will test it with filetype=angular.html
.
@Ask-786 it seems to work. I submitted a PR to nvim-treesitter
It can be solved by setting the filetype in a custom plugin: (PR #17) See here for the readme
Instead of setting the file type just angular, there is a workaround.
autocmd BufRead,BufEnter *.component.html set filetype=angular.html
we can set it to
angular.html
so the syntax highlight and all other common package related stuffs are working. like,But tailwindcss-language-server still doesn't work perfect.