Atlas Rust
Atlas Rust is a Visual Studio Code extension designed to simplify and standardise the creation of Rust modules.
It automates folder creation, mod.rs management, and module declarations, fully respecting Rust’s module system, including nested modules.
The goal of this project is to provide a Java-like project experience for Rust, without breaking idiomatic Rust practices.
✨ Features
✅ Current Features
Create Rust modules using a simple path syntax:
infra
infra/sql
infra/sql/auth
Automatically:
- Create the required folder structure
- Create
mod.rs files where needed
- Update the correct parent module (
mod.rs, lib.rs, or main.rs)
Fully supports nested modules
Prevents duplicate pub mod declarations
Works with both:
🧠 How It Works
Rust modules must be declared in their parent module, not always in the crate root.
For example, creating:
infra/sql
Produces:
src/
├── main.rs → pub mod infra;
├── infra/
│ ├── mod.rs → pub mod sql;
│ └── sql/
│ └── mod.rs
This extension follows that rule strictly, ensuring correctness and compatibility with the Rust compiler and tooling.
🚀 Usage
Open a Rust project in VS Code
Ensure it contains src/main.rs or src/lib.rs
Open the Command Palette:
Ctrl + Shift + P
Run:
Rust: Create Module
Enter a module path, for example:
infra/sql/auth
🛠 Development & Testing
This extension can be tested without installing it:
Open the extension project in VS Code
Run:
npm install
npm run compile
Press F5
A new window will open: Extension Development Host
Open a Rust project in that window and use the command
📦 Project Structure
src/
├── extension.ts # Extension entry point
├── commands/
│ └── createModule.ts # VS Code command
└── rust/
└── modules.ts # Rust module logic (core)
The Rust-specific logic is intentionally isolated to make future extensions easier and safer.
🗺 Roadmap
🔹 Short Term
Add Context Menu integration
- Right-click on a folder in
src/
- Create a module directly from the file explorer
Improve error handling and UX
Validate module names against Rust keywords
🔹 Mid Term
Support both module styles:
Detect existing modules and suggest actions
Add Code Actions (Quick Fixes)
🔹 Long Term Vision 🚀
🎯 Philosophy
This project aims to:
- Respect Rust’s module system
- Avoid fragile regex-based parsing
- Build tooling that scales from small projects to large codebases
- Provide a first-class project structure experience for Rust developers
🤝 Contributions
Contributions, ideas, and feedback are welcome.
This extension is intentionally designed with a clean internal architecture to support future growth.
📄 License
MIT License
Atlas Rust
Making Rust project structure explicit, correct, and easy to manage. 🦀