Convert to Folder

Ever typed a name like api or routes, hit Enter, and realized you just created a file instead of a folder?
Then you delete it, make a folder, and start over — two steps too many.
Convert to Folder fixes that. One small, quiet improvement that makes your workflow smoother.
✨ Features
- Converts any file into a folder with the same name
- If the file has content, it becomes
index inside the new folder
- If the file is empty, only the folder is created
- Works on Linux, macOS and Windows
🚀 Usage
- In the Explorer, right-click a file.
- Choose “Convert to Folder”.
- The extension will:
- If the file has unsaved changes, it prompts you to save before converting.
- If the file has content, it creates a folder and moves the file’s contents into an
index file.
- If the file is empty, it simply creates an empty folder.
Command:
convertToFolder.convert
You can also run it from the Command Palette (Ctrl+Shift+P / ⇧⌘P).
🧩 Installation
From Marketplace:
ext install swisstool.convert-to-folder
From source:
git clone https://github.com/swisstool-io/vscode-convert-to-folder
cd vscode-convert-to-folder
npm ci
npm run compile
npm run build:test
npm test
🧪 Requirements
| Platform |
Version |
| VS Code |
1.80+ |
| OS |
macOS, Windows, Linux |
| Node.js (for dev) |
20.x |
🛠️ Development
To run locally:
npm run compile
code .
# Press F5 to start the Extension Host
A set of small, focused developer tools for VS Code — each designed to solve one problem cleanly and get out of your way.
Explore more at swisstool.io.
🤝 Contributing
Open source contributions are welcome. If you’d like to improve this extension or report an issue, feel free to open a pull request or discussion.
See CONTRIBUTING.md (coming soon) for guidelines.
License: MIT © 2025 — made with ❤️ by Soufiane Rafik, part of Swisstool.io