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.rswill create a new submodule file. - Adding a trailing
/or no trailing symbol will create a new module directory with a new innermod.rsfile.
- Adding a trailing
- 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.rsfile, it will try to add mod line tolib.rsthen will trymain.rs.- If it still cannot find a file, it will create a new
mod.rsand append to that.
- If it still cannot find a file, it will create a new
- If there is no existing
- VSCode ^1.103.0
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.
- Module lines get added before attribute blocks (
#[]and#![]), causing errors until repositioned manually.
- Fixes typo in
package.jsonfor visibility options.
- 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.AutoFocusto work properly. - Changes to automatically create
mod.rsfile ifmain.rs,lib.rsor existingmod.rsfile is not found.
Added example images to README.md
Initial release of Rust Mod Creator


