My project setup includes a workspace with one library and one binary crate (that includes multiple binaries).
If a change a file, VScode + RLS is much slower than a plain cargo check. RLS seems to always check all binaries (judging by the RLS info in the bottom bar).
So currently on every change RLS runs for half a minute in my case, even though it would just need to check one binary.
cargo check on the other hand does a much faster incremental check.
Try disabling the all_targets config of RLS. By default it does performs closer to cargo check --all, which is why it takes longer.
With all_targets set to false, RLS no longer builds binaries from all crates in a workspace nor tests. But it still compiles all binaries in one crate. Also tried the build_bin setting - didn't help.
My current config:
"settings": {
"rust.show_warnings": false,
"rust.unstable_features": true,
"rust.build_bin": "some_binary",
"rust.all_targets": false
},
Most helpful comment
With
all_targetsset to false, RLS no longer builds binaries from all crates in a workspace nor tests. But it still compiles all binaries in one crate. Also tried thebuild_binsetting - didn't help.My current config: