Fix angular treesitter not being enabled for angular html template files

This commit is contained in:
Mykhailo Sabatura 2024-06-05 23:00:21 +02:00
parent 9a1162314f
commit 4aff4a8d0a

View file

@ -14,6 +14,18 @@ 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.api.nvim_create_autocmd("FileType", {
pattern = "angular.html",
callback = function()
vim.treesitter.language.register("angular", "angular.html")
end,
})
end, end,
}, },