added more capabilities to my nvim setup
This commit is contained in:
40
lua/plugins/lsp-roots.lua
Normal file
40
lua/plugins/lsp-roots.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
tsserver = {
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
"pnpm-workspace.yaml",
|
||||
"nx.json",
|
||||
"turbo.json",
|
||||
"package.json",
|
||||
".git"
|
||||
)(fname)
|
||||
end,
|
||||
},
|
||||
|
||||
gopls = {
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
"go.work",
|
||||
"go.mod",
|
||||
".git"
|
||||
)(fname)
|
||||
end,
|
||||
},
|
||||
|
||||
pyright = {
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
"pyproject.toml",
|
||||
"setup.py",
|
||||
".git"
|
||||
)(fname)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user