Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Convert to FolderNew to Visual Studio Code? Get it now.
Convert to Folder

Convert to Folder

SwissTool

|
2 installs
| (0) | Free
Convert extension-less files into folders with a single click
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Convert to Folder

CI Marketplace Version License: MIT

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

  1. In the Explorer, right-click a file.
  2. Choose “Convert to Folder”.
  3. 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

🛠️ Part of the SwissTool Collection

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft