RustRover 2023.3 Help

Attaching Cargo projects

When you open a local Rust project or fetch one from VCS, RustRover analyzes its structure and displays it in the Cargo tool window.

Cargo workspace displayed in the Cargo tool window

The workspace (if any), the packages, and the targets, are organized into Cargo projects. A Cargo project is defined by a Cargo.toml file and the sources contained in the corresponding folder. Identifying Cargo projects is crucial for code insight and navigation.

More often than not, RustRover will identify all Cargo projects automatically. However, in some cases (for example, if there is a Cargo.toml file outside the Cargo workspace), it may be unable to detect all of them. If you cannot find some of your Cargo projects in the Cargo tool window, consider attaching them manually.

Attach a Cargo project

Do one of the following:

  • Right-click the Cargo.toml file in the project tree and select Attach Cargo Project from the context menu.

  • In the Cargo tool window (View | Tool Windows | Cargo), click the icon and select the necessary Cargo.toml file or the directory containing it.

    Attaching Cargo projects from the Cargo tool window

As you work in the editor, RustRover checks whether the files you open belong to some Cargo project. If not, you will see a banner suggesting to attach the file to a known Cargo project.

Attaching a Cargo project via editor notification
Last modified: 08 April 2024