Skip to content
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

please support vscode per-folder workspace features #14384

Closed
rbtcollins opened this issue Mar 20, 2023 · 3 comments
Closed

please support vscode per-folder workspace features #14384

rbtcollins opened this issue Mar 20, 2023 · 3 comments
Labels
A-vscode vscode plugin issues C-feature Category: feature request

Comments

@rbtcollins
Copy link

rbtcollins commented Mar 20, 2023

I have a vscode workspace with rustup + several dependencies of rustup, allowing me to work on them together.

However, rust-analyzer doesn't seem to permit its settings in the per-folder level.
image

Setting the value in the per-folder file .vscode/settings.json seems to be ignored.

The use case is this: I would like to be able to set a feature that rustup adds to a dependency, for just that dependency, without causing errors like:


rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file c:\Users\username\Documents\src\rustup.rs\Cargo.toml, Some(Version { major: 1, minor: 68, patch: 0, pre: Prerelease("nightly") }): Failed to run `"cargo" "metadata" "--format-version" "1" "--features" "cli" "--manifest-path" "c:\\Users\\username\\Documents\\src\\rustup.rs\\Cargo.toml" "--filter-platform" "x86_64-pc-windows-msvc"`: `cargo metadata` exited with an error:     Updating crates.io index
error: none of the selected packages contains these features: cli, did you mean: curl?
@rbtcollins rbtcollins added the C-feature Category: feature request label Mar 20, 2023
@rbtcollins rbtcollins changed the title please support per-folder cargo features please support vscode per-folder workspace features Mar 20, 2023
@Veykril Veykril added the A-vscode vscode plugin issues label May 26, 2023
@Veykril
Copy link
Member

Veykril commented May 26, 2023

So, right now when using a vscode workspace, we spawn a single server that is being used for all folders. For this to work we'd need to spawn an LSP client server pair for each folder instead (and then also figure out how to allow using folder level settings), so this in itself should be gated behind a config as that becomes very resource heavy.

@rbtcollins
Copy link
Author

@Veykril I don't understand why it can't be pushed down into the LSP ?

Ignoring the workspace case, all the crates that a single crate depends on end up with their own independent enabled features - rustup has features x,y,z, depends on tokio, then tokio ends up having feature a,b,c enabled.

What I'm asking for is the ability to tell the LSP that the rustup crate should have features x,y,z enabled, without it also attempting to enable features x,y,z for tokio.

That seems to be entirely in the glue layer, or am I missing something?

@Veykril
Copy link
Member

Veykril commented May 26, 2023

However, rust-analyzer doesn't seem to permit its settings in the per-folder level.

With this I assumed you meant general folder level vscode configuration sorry. Yes you are right, this is merely a config exposure issue then. In that case this issue is #10298

@Veykril Veykril closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants