project.nvim
project.nvim copied to clipboard
Duplicate LSP when open buffers from different projects
Hi guys!
I use to work in a big monorepo. Sometimes I have to work on several buffers that belong to different projects. What happens is that it opens an instance of LSP ttserver
for each project. Is there any way to fix this?
Thanks!
This is not related to project.nvim
. I have the same problem. Add this to your lspconfig.tsserver.setup
argument
root_dir = function(fname)
return util.root_pattern(".git")(fname)
or util.root_pattern("package.json", "tsconfig.json", "jsconfig.json")(
fname
)
end,
This, however will now probably mess up project.nvim
projects, since it figures out the project based on lsp. You might want to change the default option to this:
detection_methods = { "pattern", "lsp" },
I am still figuring out what's the best way to work with monorepos.