Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Dart Import CollapserNew to Visual Studio Code? Get it now.
Dart Import Collapser

Dart Import Collapser

mrgnhnt96

| (0) | Free
Automatically collapse Dart import statements for cleaner code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dart Import Collapser

A VS Code extension that automatically collapses Dart import statements to keep your code clean and focused.

Features

  • Automatic Collapse: Automatically collapses import blocks when you open Dart files
  • Manual Control: Use commands to collapse or expand imports at any time
  • Smart Detection: Identifies and groups consecutive import/export statements
  • Configurable: Toggle auto-collapse behavior in settings

Commands

  • Collapse Dart Imports - Manually collapse all import blocks in the current file
  • Expand Dart Imports - Expand all collapsed import blocks

Configuration

  • dartImportCollapser.autoCollapse - Automatically collapse imports when opening Dart files (default: true)
  • dartImportCollapser.collapseOnRefocus - Collapse imports when re-focusing a Dart file (default: true)
  • dartImportCollapser.collapseParts - Collapse part directives (default: true)

Usage

  1. Open any Dart file
  2. Import statements will automatically collapse (if auto-collapse is enabled)
  3. Click the folded region to expand imports
  4. Use Command Palette (Cmd+Shift+P / Ctrl+Shift+P) to run collapse/expand commands

Requirements

  • VS Code 1.80.0 or higher

Installation

  1. Open VS Code
  2. Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  3. Search for "Dart Import Collapser"
  4. Click Install

Development

# Install dependencies
npm install

# Compile
npm run compile

# Watch for changes
npm run watch

License

MIT

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