-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi-root workspace in vscode #1104
Comments
We don’t need to start separate instances of analyzer, the code is well prepared to handling arbitrary crate graphs. This is he bit where this happens: https://github.com/rust-analyzer/rust-analyzer/blob/84d8665e13007b0ee27e2a42ff74db815923cdce/crates/ra_lsp_server/src/main_loop.rs#L60 As you see, we already construct a vector of workspaces(of length one at the moment). To support multiroot setup, we should extend this code to scan several roots |
I've been experimenting a bit with this and it looks like VSCode reloads the extension completely when a folder is added to the workspace. That would mean that supporting multiple workspaces doesn't yet require full-fledged dynamic workspace loading. I could prepare a PR for this "hack" and/or work on the "full" solution later (if nobody is working on this). Maybe related/interesting microsoft/vscode#28122 |
This is a quick, partial fix for rust-lang#1104
This is a quick, partial fix for rust-lang#1104
Does multiroot workspace really work? I've got a workspace, with projects, and within a particular project, there is subdirectory with the rust project. I read somewhere that this extension only detects rust projects 1 level deep. Is there a way to configure this or to tell the extension where the rust project is? |
You can use the rust-analyzer.linkedProjects config in case rust-analyzer failed to auto-detect it. Make sure to also include the Cargo.toml files that previously got auto-detected. Setting it disables all auto-detection. |
I think we could use the approach in https://github.com/rust-lang/rls-vscode/pull/333/files, start analyzer for every dir in the workspace
The text was updated successfully, but these errors were encountered: