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
- Open any Dart file
- Import statements will automatically collapse (if auto-collapse is enabled)
- Click the folded region to expand imports
- Use Command Palette (
Cmd+Shift+P / Ctrl+Shift+P) to run collapse/expand commands
Requirements
Installation
- Open VS Code
- Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
- Search for "Dart Import Collapser"
- Click Install
Development
# Install dependencies
npm install
# Compile
npm run compile
# Watch for changes
npm run watch
License
MIT
| |