Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Smart Fold ToggleNew to Visual Studio Code? Get it now.
Smart Fold Toggle

Smart Fold Toggle

Minhaz

|
4 installs
| (0) | Free
One-click smart folding that exposes the most useful outline level, including methods inside large classes.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Smart Fold Toggle

Smart Fold Toggle adds a small button to the right side of the VS Code status bar:

  • Smart Fold chooses a useful outline depth and folds at that level.
  • Expand All unfolds every region in the active editor.

It uses VS Code's built-in folding commands and never edits or saves your files.

Smart depth

The extension uses the document outline supplied by the current language:

  • Files containing ordinary top-level functions fold at level 1.
  • Files made of one or more classes fold at level 2, exposing their methods.
  • Wrapper structures such as a namespace containing classes can fold at level 3.
  • Folding is always capped at level 3, so it does not descend through nested implementation details.

If a language does not provide an outline, the extension safely falls back to level 1.

Usage

  1. Open a file that supports code folding.
  2. Click Smart Fold in the status bar.
  3. Click Expand All to restore the full editor view.

The same actions are available from the Command Palette:

  • Smart Fold Toggle: Toggle Smart Folding
  • Smart Fold Toggle: Smart Fold
  • Smart Fold Toggle: Expand All

Notes

Folding and outline symbols are provided by VS Code and the language extension for the current file, so exact behavior can vary by language. VS Code does not expose the current folding state to extensions; the button reflects the most recent action performed by this extension for each open file.

Development

pnpm install
pnpm check

Press F5 in VS Code to launch an Extension Development Host.

License

MIT

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