Replies: 2 comments 1 reply
-
|
The idea would be that I could make root_dir = function(filename, default)
local clients = vim.lsp.get_clients({ name = 'rust-analyzer' })
local found_dirs = vim.fs.find({ '.vscode' }, { upward = true, path = vim.fs.dirname(filename), type = 'directory' })
if #found_dirs == 0 then
return default(filename)
end
return vim.fs.dirname(found_dirs[1])
end,I got this to work with a very minor patch to rustaceanvim; However, despite multiple instances of rust-analyzer, they use the same config (the config from the last opened workspace). |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I suppose this is now a duplicate of #869? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Feature description
When using a single instance of neovim to work on more than one workspace, with different workspace configurations, the config is overwritten.
The following repository has this workspace setup:
(https://github.com/Leandros/nvim-lsp-test)
The root workspace is configured to build on the host architecture, and the
crossworkspace is configured to compile for a foreign architecture (eg.thumbv7m-non-eabi, for embedded work).Both workspaces have different architectures configured through
.vscode/settings.json. However, depending on which workspace is opened last in neovim, the settings of the first workspace are overwritten and the single rust-analyzer instance is now using an invalid architecture (and therefore, diagnostics break).The repository linked can be used to easily reproduce the issue by opening it and editing
cross/cross-crate/src/main.rsandhost/host-crate/src/main.rsin any order. The settings from the first opened workspace are not present in the config for rust-analyzer.This severely inhibits a good working experience for embedded projects.
A "quick" solution would be to spawn (with a configuration) a single rust-analyzer instance for each workspace.
Beta Was this translation helpful? Give feedback.
All reactions