From fd4c38bc2b2fcf81e6f871e60087022e6d7a23c7 Mon Sep 17 00:00:00 2001 From: Mykhailo Sabatura <34069301+mishasbtr@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:31:25 +0200 Subject: [PATCH] fix(angular): re-fix angular html treesitter (#3488) This was previously attemped to be fixed by https://github.com/LazyVim/LazyVim/pull/3469, which caused an issue with angular LSP. The PR was reverted as mentioned in https://github.com/LazyVim/LazyVim/pull/3485. This PR implements suggestion by @folke, which fixes treesitter without breaking LSP. --- lua/lazyvim/plugins/extras/lang/angular.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/angular.lua b/lua/lazyvim/plugins/extras/lang/angular.lua index ce8a62e4..fef54cc7 100644 --- a/lua/lazyvim/plugins/extras/lang/angular.lua +++ b/lua/lazyvim/plugins/extras/lang/angular.lua @@ -14,6 +14,12 @@ return { if type(opts.ensure_installed) == "table" then vim.list_extend(opts.ensure_installed, { "angular", "scss" }) end + vim.api.nvim_create_autocmd("BufRead", { + pattern = { "*.component.html", "*.container.html" }, + callback = function() + vim.treesitter.start(nil, "angular") + end, + }) end, },