fix(extra-lang-angular): implement @folke suggestion for fixing angular treesitter

This commit is contained in:
Mykhailo Sabatura 2024-06-06 11:28:37 +02:00
parent 86811ad7aa
commit 11ce94e185

View file

@ -14,13 +14,12 @@ 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({ vim.api.nvim_create_autocmd("BufRead", {
pattern = { pattern = { "*.component.html", "*.container.html" },
[".*%.component%.html"] = "angular.html", callback = function()
[".*%.container%.html"] = "angular.html", vim.treesitter.start(nil, "angular")
}, end,
}) })
vim.treesitter.language.register("angular", "angular.html")
end, end,
}, },