mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
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:
parent
46eb3242d3
commit
2fd07da9a8
1 changed files with 7 additions and 4 deletions
|
|
@ -1,9 +1,11 @@
|
||||||
|
local angular_root_pattern = { "angular.json", "project.json" }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
root = {
|
root = {
|
||||||
"angular.json",
|
"angular.json",
|
||||||
"nx.json", --support for nx workspace
|
"project.json", --support for angular monorepo workspace
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
@ -31,9 +33,10 @@ return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
angularls = {},
|
angularls = {
|
||||||
},
|
root_dir = function(root_dir)
|
||||||
setup = {
|
return require("lspconfig.util").root_pattern(unpack(angular_root_pattern))(root_dir)
|
||||||
|
end,
|
||||||
angularls = function()
|
angularls = function()
|
||||||
LazyVim.lsp.on_attach(function(client)
|
LazyVim.lsp.on_attach(function(client)
|
||||||
--HACK: disable angular renaming capability due to duplicate rename popping up
|
--HACK: disable angular renaming capability due to duplicate rename popping up
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue