How can we get automatic Cargo.toml discovery without any per-Cargo.toml intervention? i.e. suppose you pathologically create dozens of "cargo new mytest_xxx" in your bigger-than-just-rust vscode working directory.
Maybe this already solved but it seems like there is a lot of noise when searching for it and all the threads on here than come up in search seem to be closed already. See
If this is not solved in a way that is planned to be default, the recommended extension should be reverted to the old one which seemed to work.
My standard approach is to create a Cargo.toml file at the root of the repository and make my project a cargo workspace.
Assuming your repo has multiple projects in it where each project may contain a Rust crate, my Cargo.toml file would then look like this:
[workspace]
members = [
"project-a/crate-a",
"project-c/crate-c",
"big-rust-project/crates/*"
]
The nice thing about having a top-level Cargo.toml like this is that you can do cargo build or cargo run from anywhere within the repository (especially useful when using the cargo xtask pattern). It also simplifies CI because you can do cargo check --workspace && cargo test --workspace to compile+test all your Rust code, and the target/ folder is shared.
It sounds like if one absolutely has to migrate to the new extension (avoid/defer for now if possible) one should symlink to top level entry point. A better option would be to increase depth of search somehow.