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.
Create a new Rust file
In the Project tool window (Alt+1), right-click the node in which you want to create the new file and select .
Alternatively, select the necessary node, press Alt+Insert, and select Rust File.
In the dialog that opens, specify the file name and choose whether you want to attach it 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.
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.
Create a Cargo crate
In the Project tool window (Alt+1), right-click the node in which you want to create the new file and select .
Alternatively, select the necessary node, press Alt+Insert, and select Cargo Crate.
Name the new crate and select its type (Binary or Library).
Create a file of an arbitrary type
In the Project tool window (Alt+1), right-click the node in which you want to create a new file and click .
Alternatively, select the node, press Alt+Insert, and click File.
Name the new file and specify its extension, for example: File.js, and press Enter.
Create a scratch file
Go to
or press Ctrl+Alt+Shift+Insert.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.
Create a new directory
In the Project tool window (Alt+1), right-click the node in which you want to create a new directory and select .
Alternatively, select the node, press Alt+Insert, and click Directory.
Name the new directory and press Enter.
If you want to create several nested directories, specify their names separated with slashes, for example: folder/new-folder.