Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode does not work when it has multiple cargo projects?

I'm learning to use rust,i am using vscode。 I have two cargo projects in my workspace,Why rust-analyzer only has an error message in the first project, but not in the second。 enter image description here

enter image description here

Is there any setting required?

like image 689
Itsme Avatar asked Jun 16 '26 12:06

Itsme


1 Answers

You need to create workspace:

  • Create Cargo.toml in your root project
  • Add this code:
[workspace]
members = [
    "./<your-cargo-project1>",
    "./<your-cargo-project2>",


]
like image 95
CocDap Avatar answered Jun 18 '26 02:06

CocDap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!