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 {
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue