How to get the workspace working

Hi, I'm so new to this!! My previous experience programming was with JS, I just decided to pick up Rust as well for fun. I'm entirely hobby programmer so no harm in that? I know all of these are complex and require lot of effort to learn, but it's still fun to do casually.

But, having hard time setting up a project. I use VS Code for most things I do. In the documentation it seems more like it's guiding you to do something upon installation of VS Code? I already have it installed. I tried to get the C++ development options, and also got this rust analyser, but it has a hard time fetching the workspace.

obrazek
Here's exact error it puts.

I'm not very familiar with all these since, again all my previous was JavaScript, and being all pure-web it doesn't need much intensive work as here, but I want to learn still. Any help is appreciated a lot!! Thank you for considering me and taking time to help me, I'm taking my baby steps into programming. No clear goal what I want to make just, "well, it could be fun, why not" as my motivation!

Ah wait this too


It's trying to read from this folder that doesn't exist, while also outputting the other error.

Would it be possible to share the whole project folder?

1 Like

your folder should be in the form

my_project
   |-src
   |  |-your surce files
   |-Cargo.toml

you can set it all up by just running cargo init inside my_project after that just opening the my_project folder in vs code should work

Please share your workspace tree and the contents of its Cargo.toml files.

It should look something like this:

~/RustroverProjects/apis-saltans> tree -L 2
.
├── aps
│   ├── Cargo.toml
│   └── src
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── logo.png
├── macros
│   ├── Cargo.toml
│   └── src
├── nwk
│   ├── Cargo.toml
│   ├── README.md
│   ├── src
│   └── TODO.md
├── README.md
├── rustfmt.toml
├── supply-chain
│   ├── audits.toml
│   ├── config.toml
│   └── imports.lock
├── target
│   ├── armv7-unknown-linux-musleabihf
│   ├── CACHEDIR.TAG
│   ├── debug
│   └── release
├── TODO.md
├── zcl
│   ├── Cargo.toml
│   ├── src
│   └── TODO.md
├── zdp
│   ├── Cargo.toml
│   ├── src
│   └── TODO.md
└── zigbee
    ├── Cargo.toml
    └── src

With the workspace's Cargo.toml listing its appropriate member crates:

[workspace]
members = ["zigbee", "zcl", "nwk", "zdp", "aps", "macros"]
resolver = "3"
2 Likes