mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
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:
parent
4d1629605b
commit
24af74eed6
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,13 @@ return {
|
||||||
if type(opts.ensure_installed) == "table" then
|
if type(opts.ensure_installed) == "table" then
|
||||||
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
|
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
|
||||||
end
|
end
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = {
|
||||||
|
[".*%.component%.html"] = "angular.html",
|
||||||
|
[".*%.container%.html"] = "angular.html",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.treesitter.language.register("angular", "angular.html")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue