feat(angular): Better project detection

Since nx is not meant to only be used with angular, this will make sure
`extras/angular` only shown to the angular default + monorepo projects.
This commit is contained in:
Radvil 2024-06-12 22:22:54 +08:00
parent 46eb3242d3
commit 2fd07da9a8

View file

@ -1,9 +1,11 @@
local angular_root_pattern = { "angular.json", "project.json" }
return {
recommended = function()
return LazyVim.extras.wants({
root = {
"angular.json",
"nx.json", --support for nx workspace
"project.json", --support for angular monorepo workspace
},
})
end,
@ -31,9 +33,10 @@ return {
"neovim/nvim-lspconfig",
opts = {
servers = {
angularls = {},
},
setup = {
angularls = {
root_dir = function(root_dir)
return require("lspconfig.util").root_pattern(unpack(angular_root_pattern))(root_dir)
end,
angularls = function()
LazyVim.lsp.on_attach(function(client)
--HACK: disable angular renaming capability due to duplicate rename popping up