RustRover 2024.3 Help

Working with TOML files

RustRover provides extensive support of the TOML format. Find an overview of the main features below.

Highlighting and code style

The highlighting and code style settings are applied to .toml files automatically. You can adjust the settings in Settings | Editor | Color Scheme | TOML and Settings | Editor | Code Style | TOML.

Code reference information

In Cargo.toml, you will see special hints alongside crate versions. These hints indicate the crate's version currently recorded in Cargo.lock as well as latest one (if available).

Inlay hints for crates

Code completion

Code completion works for most manifest keys as well as Cargo features. You can also autocomplete local dependency paths and navigate to the source via click:

Code insight for paths in Cargo.toml

When specifying dependencies from crates.io, you can autocomplete their names and versions:

Completion for names and versions of dependencies from crates.io

Enabling and disabling features

The IDE provides a dedicated UI for enabling/disabling Cargo workspace features. It also allows you to specify the target architecture, automatically filtering the appropriate workspace features.

For more information, refer to Support for conditional compilation.

You can navigate across Cargo features and jump to feature declarations from cfg and cfg_attr attributes:

Completion and navigation for Cargo features

Inspections

The IDE runs a number of inspections to verify Cargo.toml. For example, it checks whether the referenced crates exist and whether their versions are up-to-date. It also detects any cyclic feature dependencies.

Most problems can be fixed in one click – press Alt+Enter to view the options:

Applying a quick-fix in Cargo.toml

To view the full list of Cargo.toml inspections, go to Settings | Editor | Inspections and expand the Rust | Cargo.toml node:

The list of Cargo.toml inspections in settings

You can also find inspection descriptions on Inspectopedia.

View crate documentation

You will see a docs.rs gutter icon next to each extern crate declaration – you can use it to quickly open the crate's description on docs.rs in your browser:

Opening docs.rs from Cargo.toml
Last modified: 18 September 2024