fix(angular): treesitter not enabled for angular templates (#3469)
## Problem Treesitter was not working in angular html templates after enabling `lang.angular` extra. ## Solution Added a change recommeded by angular treesitter developer to enable treesitter for components and containers. ### Reference to recommendation in treesitter docs [Reference to the recommendation for this hack](https://github.com/dlvandenberg/tree-sitter-angular?tab=readme-ov-file#filetype).
This commit is contained in:

committed by
GitHub

parent
4d1629605b
commit
24af74eed6
@ -14,6 +14,13 @@ return {
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
|
||||
end
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*%.component%.html"] = "angular.html",
|
||||
[".*%.container%.html"] = "angular.html",
|
||||
},
|
||||
})
|
||||
vim.treesitter.language.register("angular", "angular.html")
|
||||
end,
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user