Closed mhartington closed 4 months ago
I think you should inject the angular parser on the template node in a plugin like nvim-treesitter.
For example, you can take a look at the injections for typescript. The angular parser is injected on the template
part.
Or better, you can look at how it is done for vue
👋 Hey there, I'm working on a tree-sitter grammar for Analog.js, which is a meta-framework on top of Angular.
Analog offers a single file component syntax via the
.angalog
filetype, which ends up being very similar to Vue, but still uses Angular's template syntax in atemplate
block.I'm currently trying to integrate this tree-sitter grammar as it can provide all the new control flow syntax, but a bit lost in how this should be done effectively.
Extending it in
grammar.js
creates a parsing error in the final document, but trying to grab the wholetemplate-element
doesn't seem to allow for injectingangular.html
on the template segment.