LazyVim icon indicating copy to clipboard operation
LazyVim copied to clipboard

bug: Both denols and vtsls LSPs running in monorepo

Open nounder opened this issue 6 months ago • 2 comments

Did you check docs and existing issues?

  • [X] I have read all the LazyVim docs
  • [X] I have updated the plugin to the latest version before submitting this issue
  • [X] I have searched the existing issues of LazyVim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0

Operating system/version

MacOS 15.0

Describe the bug

In TypeScript mono repo setup, two typescript LSPs are running at the same time.

Root directory for vtsls and denols are different. vtsls points to expected directory (ie. when package.json and tsconfig.json is found). denols points to a git repo even though there are no deno.json anywhere in sight.

Related code that handles those two LSPs:

https://github.com/LazyVim/LazyVim/blob/12818a6cb499456f4903c5d8e68af43753ebc869/lua/lazyvim/plugins/lsp/init.lua#L248-L257

Steps To Reproduce

mkdir monorepo
cd monorepo
git init
mkdir pkg
echo '{}' > pkg/tsconfig.json
cd pkg
nvim

While in nvim, run C-c -l and see both denols and vtsls running and causing conflicting formatting and auto complete.

Expected Behavior

denols has the same working directory as vtsls so LazyVim's code to handle those conflicting LSPs will work properly for monorepos:

https://github.com/LazyVim/LazyVim/blob/12818a6cb499456f4903c5d8e68af43753ebc869/lua/lazyvim/plugins/lsp/init.lua#L248-L257

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- add any other plugins here
  },
})

nounder avatar Aug 18 '24 12:08 nounder