rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.26k stars 1.61k forks source link

support per-folder settings in multi-root VSCode workspaces #17086

Open jyn514 opened 6 months ago

jyn514 commented 6 months ago

VSCode has a feature where multiple "folders" can be part of the same "workspace" (shown in the same window, basically). for the most part, this works out of the box with rust-analyzer. however, RA doesn't allow settings to be configured per-folder, only per-workspace.

image

the toml extension i'm using allows per-folder settings, so presumably this is under the control of the extension. it would be nice if it were supported by RA.

image

Veykril commented 6 months ago

Would be great to have, but I don't think the LSP allows us to do this ... And we'd also need to add support for multi configs for a server here (although we are technically implementing this already for the rust-analyzer.toml). Or we spawn a server per folder in a vscode workspace which will blow up resource usage, so not really a nice option either.

jyn514 commented 6 months ago

hmm, the c++ extension manages it somehow, presumably it's going through the lsp protocol? i don't know exactly how it does it. image

jyn514 commented 6 months ago

for the most part, this works out of the box with rust-analyzer.

i take it back; rust-analyzer isn't showing red squigglies for projects in the workspace :( go-to-definition and such work ok, but there's no error indicator for methods or paths that don't exist. never mind, i just had check-on-save turned off