Configure rust-analyzer to use with multi workspace/multitarget project

I'm playing with multitarget Rust project (IoT) so need to have some workspaces with different targets including wasm+no_core (for raw WASM without bindgen use, for learning purposes).

I'm use VSCode + analyzer for code editing, so I have a lot of incorrect errors and warning in analyzer default configuration.

How can I set some config in .vscode/settings.json separately for each sub-workspace to set a correct --target and compiler flags, or at least eliminate badly runs of cargo check etc ?

If you want to make the correct target you can change the contents of .cargo/config.toml, rust-analyzer should respect it. For example putting

target = wasm32-unknown-unknown

in the workspace for WASM projects.

Its the first thing I tried, and it looks not works for sub-workspaces.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.