Add new items to Cargo projects
RustRover makes it easy to add new items to your project, be it Cargo crates, directories, Rust files, or files with other extensions.

In the Project tool window (), right-click the node in which you want to create the new file and select New | Rust File.
Alternatively, select the necessary node, press , and select Rust File.
In the dialog that opens:
Specify the file name
note
Use
snake_case
to keep in line with Rust naming conventions. Do not use dashes (-
).note
You can also specify new directories in which you would like to nest the file. E.g.
dir/subdir/mod
will create the following structure in the current directory:dir | subdir | | mod.rs
Choose whether you want to attach the new file to the current module
If you select Attach to module, RustRover will add the file declaration to the module's target (
main.rs
orlib.rs
). If RustRover fails to identify the appropriate target, the file won’t be attached.Gif
If you open a Rust file that is not attached to any module, RustRover will display a banner suggesting to attach it to the current module's target.

In the Project tool window (), right-click the node in which you want to create the new file and select New | Cargo Crate.
Alternatively, select the necessary node, press , and select Cargo Crate.
Name the new crate and select its type (Binary or Library).
In the Project tool window (), right-click the node in which you want to create a new file and click New | File.
Alternatively, select the node, press , and click File.
Name the new file and specify its extension, for example: File.js, and press .
Go to File | New | Scratch File or press .
Select the language of the scratch file.
Scratch files of the same type are automatically numbered and added to the Scratches and Consoles directory of the Project view.
tip
RustRover numbers scratch files sequentially starting from 1. If you close a tab with an empty scratch file, RustRover deletes it.
In the Project tool window (), right-click the node in which you want to create a new directory and select New | Directory.
Alternatively, select the node, press , and click Directory.
Name the new directory and press .
If you want to create several nested directories, specify their names separated with slashes, for example: folder/new-folder.