-
Neovim version (nvim -v)0.10 Operating system/versionmacos14.2 Output of :checkhealth rustaceanvim==============================================================================
rustaceanvim: require("rustaceanvim.health").check()
Checking for Lua dependencies ~
- WARNING dap not installed. Needed for debugging features [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap)
Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.76.0 (07dca489 2024-02-04)
- OK Cargo: found cargo 1.76.0 (c84b36747 2024-01-18)
- OK rustc: found rustc 1.76.0 (07dca489a 2024-02-04)
- OK debug adapter: found codelldb
Checking config ~
- OK No errors found in config.
Checking for conflicting plugins ~
- OK No conflicting plugins detected.
Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected. How to reproduce the issueopen two rust file at different folders. Expected behaviourstart two rust-analyzer instance as lspconfig do/ Actual behaviourthe two different project share signle server. This makes nvimtree sync with cwd broken, make session manage plugin broken. rustacean: start only one server, cause cwd to change when toggle tree. mason+lspconfig: start two server, file tree woks fine. The minimal config used to reproduce this issue.default config |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hey 👋 Starting a single client and registering workspace changes via This sounds like a bug in nvim-tree. Converting to a discussion. |
Beta Was this translation helpful? Give feedback.
I see. Again, this is the intended behaviour. See also this comment on a related lspconfig issue.
Please keep in mind that Neovim has no concept of a workspace. That is something that is implemented by plugins like
project.nvim
.If nvim-tree (or some project management plugin you're using) is using the LSP client's
config.root_dir
as the source of truth to set thecwd
or for the current buffer's project root, and is ignoring theworkspace_folders
, that's a bug.It should be using the client's
workspace_folders
property, comparing theuri
s with the current buffer's path, and then fall back to theconfig.root_dir
if it can't find a match in theworkspace_folders
.If I have two files from di…