-
Checked other resources
DescriptionI upgraded to the latest plugin version today and noticed that when I work with a workspace, after a few seconds, the plugin sets my working directory to be my current crate. I notice this when I open the explorer after a few seconds (I'm using LazyVim and Snacks Explorer). Before I go through the trouble of reproducing minimally and creating an issue - is this intended with the recent 6.0 changes? I looked through the documentation to easily change/turn it off but couldn't see that either. I was able to reproduce this by cloning this reprository, opening Example CodeUsing LazyVim with no custom config. Neovim version (nvim -v)0.11 Operating system/versionmacOS 15.4 Output of :checkhealth rustaceanvim==============================================================================
rustaceanvim: require("rustaceanvim.health").check()
Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.
Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.86.0 (05f9846f893 2025-03-31)
- OK Cargo: found cargo 1.86.0 (adf9b6ad1 2025-02-28)
- OK rustc: found rustc 1.86.0 (05f9846f8 2025-03-31)
- OK cargo-nextest: found cargo-nextest 0.9.93
- 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. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey 👋 EDIT: There was a regression in root directory detection (parsing cargo metadata failed because it was done outside of the nvim event loop). rustaceanvim doesn't set the working directory. It's likely you're using another plugin (like project.nvim) that sets the working directory based on the LSP client's root directory. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help and thanks so much for your work on this tool, it's made my neovim/rust journey delightful. |
Beta Was this translation helpful? Give feedback.
Hey 👋
EDIT: There was a regression in root directory detection (parsing cargo metadata failed because it was done outside of the nvim event loop).
Fixed in #725.
rustaceanvim doesn't set the working directory. It's likely you're using another plugin (like project.nvim) that sets the working directory based on the LSP client's root directory.
The fact that the behaviour has changed with an update to version 6 indicates that there could be a regression in root directory detection. Or, your other plugin has an issue with the fact that rustaceanvim v6 defaults to asynchronous root directory detection.