rust-mod-creator
This extension makes it easy to create and update Rust modules and submodules.
- In the file explorer, right-click in the directory you want to create your new module or submodule.
- Click "Create New Module".
- Enter the name of your new Module.
- Adding a trailing
. or .rs will create a new submodule file.
- Adding a trailing
/ or no trailing symbol will create a new module directory with a new inner mod.rs file.
- Select the access modifier for your new Module.
- New module is now created and added to the top of existing
mod.rs .
- If there is no existing
mod.rs file, it will try to add mod line to lib.rs then will try main.rs .
- If it still cannot find a file, it will create a new
mod.rs and append to that.
Features


Create modules using commands

Requirements
Extension Settings
This extension contributes the following settings:
rustModCreator.autoFocus : Automatically focus the newly created module file in the editor.
rustModCreator.showSuccessMessage : Shows message that a new module was created.
rustModCreator.visibilityOptions : Choose what visibility options show when creating a module.
Known Issues
- Module lines get added before attribute blocks (
#[] and #![] ), causing errors until repositioned manually.
Release Notes
0.0.4
- Fixes typo in
package.json for visibility options.
0.0.3
- Adds config option to disable message on successful module creation.
- Adds config option to change visibility options when creating a module.
- Fixes issue when creating a module from command where it would not actually create the module.
- Fixes
rustModCreator.AutoFocus to work properly.
- Changes to automatically create
mod.rs file if main.rs , lib.rs or existing mod.rs file is not found.
0.0.2
Added example images to README.md
0.0.1
Initial release of Rust Mod Creator
| |