RustRover 2025.2 Help

Add new items to Cargo projects

RustRover makes it easy to add new files, crates, modules, and directories to your Rust projects.

Add files from Project tool window toolbar

Create a new Rust file

  1. In the Project tool window (Alt+1), select the node in which you want to create the file, click on the toolbar, and select Rust File.

    Alternatively, select the necessary node, press Alt+Insert, and select Rust File.

  2. In the dialog that opens:

    1. Specify the file name

    2. Choose whether you want to include the new file in the current module.

    If you select Attach to module, RustRover will add the file declaration to the module's target (main.rs or lib.rs). If RustRover fails to identify the appropriate target, the file won’t be attached.

    Creating a new Rust file

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.

Quick fix to attach the open Rust file to the current module

Create a module

  1. In the Project tool window (Alt+1), select the parent module (directory or file), click on the toolbar, and select Rust Module.

    Alternatively, select the necessary node, press Alt+Insert, and select Rust Module.

  2. Specify the module name and choose whether you want the new module to be a file or a directory with mod.rs inside.

RustRover will automatically add the necessary definition to the parent module.

Adding a nested Rust module

Create a Cargo crate

  1. In the Project tool window (Alt+1), select the node in which you want to create the crate, click on the toolbar, and select Cargo Crate.

    Alternatively, select the necessary node, press Alt+Insert, and select Cargo Crate.

  2. Name the new crate and select its type (Binary or Library).

    Creating a new cargo crate

RustRover will create the new binary / library crate under the selected node.

Create a file of an arbitrary type

  1. In the Project tool window (Alt+1), right-click the node in which you want to create a new file and click New | File.

    Alternatively, select the node and click on the toolbar or press Alt+Insert. Then select File.

  2. Name the new file and specify its extension, for example: File.js, and press Enter.

Create a scratch file

  1. Go to File | New | Scratch File or press Ctrl+Alt+Shift+Insert.

    Alternatively, in the Project tool window (Alt+1), click on the toolbar and select Scratch File.

  2. 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

  1. In the Project tool window (Alt+1), right-click the node in which you want to create a new directory and select New | Directory.

    Alternatively, select the node and click on the toolbar or press Alt+Insert. Then select Directory.

  2. Name the new directory and press Enter.

    Creating a new directory
11 September 2025