Skip to main content

Zed Extension

warning

Community-driven: This Zed integration is maintained by the community (third-party repository) and is not officially maintained or supported by the DCM team. Functionality and stability may evolve independently. Please report issues in the extension repository.

The Zed extension brings DCM into the Zed IDE for Dart and Flutter projects.

Installation​

Prerequisites​

  1. Install DCM — Follow the installation guide for your platform (macOS, Linux, or Windows).
  2. Ensure dcm is available in your PATH and verify with dcm version.
  3. Have Rust installed if building from source: rustup

Build From Source​

Clone the community repository and build (repository: nelsoncampos-cloudwalk/dcm-zed-extension):

git clone https://github.com/nelsoncampos-cloudwalk/dcm-zed-extension.git
cd dcm-zed-extension
cargo build --release

This produces extension.wasm in the repository root, along with extension.toml and other build artifacts.

.
├── Cargo.lock
├── Cargo.toml
├── Justfile
├── LICENSE
├── README.md
├── extension.toml
├── extension.wasm
├── src
└── target

The recommended way to install a locally-built extension is via Install Dev Extension:

  1. Open the Extensions panel in Zed: Cmd+Shift+X (macOS) or Ctrl+Shift+X (Linux/Windows)
  2. Click the Install Dev Extension button (or run zed: install dev extension from the command palette)
  3. Select the directory containing the cloned dcm-zed-extension folder
  4. Zed will load the extension immediately

DCM & Zed IDE

This method is preferred because Zed handles the extension loading and validation automatically. You can see verbose output via:

zed --foreground

Then check zed: open log if the extension fails to load.

Manual Installation (Advanced)​

If you prefer to manually copy the entire extension folder, copy the entire dcm-zed-extension directory to your Zed extensions folder:

macOS:

cp -r dcm-zed-extension ~/Library/Application\ Support/Zed/extensions/installed/dcm

Linux:

cp -r dcm-zed-extension ~/.local/share/zed/extensions/installed/dcm

Windows:

xcopy dcm-zed-extension %APPDATA%\Zed\extensions\installed\dcm\ /E /I

Restart Zed and the extension will be loaded automatically.

Troubleshooting Extension Not Appearing​

If the DCM extension doesn't appear in the Extensions panel after installation:

  1. Fully restart Zed — Close Zed completely and relaunch it (sometimes needed for language servers to register).
  2. Check extension logs — Open command palette (Cmd+Shift+P / Ctrl+Shift+P) and run zed: open log to look for DCM errors.
  3. Verify installation path — Ensure files are in extensions/installed/dcm/ (not just extensions/dcm/).
  4. Check extension.toml is valid — The file should declare [language_servers.dcm] and languages = ["Dart"].
  5. Open a Dart/Flutter project — The extension may only activate when a Dart file is detected.

Configuration​

Add a dcm block to your Zed settings.json (open Command Palette and search for "Open Settings" if unsure):

settings.json
{
"dcm": {
"dart_sdk_path": "/absolute/path/to/dart-sdk", // Optional override
"executable_path": "/absolute/path/to/dcm", // Optional if not in PATH
"disable_baseline": false, // Show issues hidden by baseline if true
"enable_old_formatter": false // Use pre-Dart 3.7 formatter
}
}

Configuration Options Explained​

  1. Dart SDK Path – Override auto-detection (supports FVM symlink .fvm/flutter_sdk).
  2. Executable Path – Use custom dcm binary if not on PATH.
  3. Disable Baseline – Reveal issues currently suppressed by baseline.
  4. Enable Old Formatter – Use legacy Dart formatter (pre 3.7).

After successfully installed and configured, you should be able to see the DCM analysis in your IDE.

DCM & Zed IDE Issue

Enabling Automatic Fixes​

Zed enables per-language save/format actions via its languages configuration. Instead of a global editor.codeActionsOnSave (as in VS Code), you attach a single code action to a language's formatter block.

To have DCM apply all safe fixes whenever you format (and on save if you also enable format-on-save), add a Dart language entry:

settings.json
{
"languages": {
"Dart": {
"code_actions_on_format": {
"source.dcm.fixAll": true
},
"format_on_save": "on", // ensure formatting runs on save
"formatter": []
}
}
}

If you want to allow potentially unsafe transformations, you can opt in explicitly:

{
"languages": {
"Dart": {
"code_actions_on_format": {
"source.dcm.unsafeFixAll": true
},
"format_on_save": "on", // ensure formatting runs on save
"formatter": []
}
}
}

Notes:

  • Only one code_action can be specified per language formatter block; choose between source.dcm.fixAll and source.dcm.unsafeFixAll (verify the exact identifier in the extension repository if they differ).
  • The sequence is: manual format trigger (or save if enabled) → code action runs → changes applied.
  • Ensure the DCM extension is active; otherwise the code action identifiers will not be registered.
  • For performance-sensitive projects you can disable fixes on save and invoke "Fix All Auto-fixable Problems" manually via the command palette.

Troubleshooting: Open the command palette and run "Restart Analysis Server" if fixes stop appearing; verify the Dart SDK path and that dcm --version works in an external terminal.

Locating the Dart SDK​

By default, the tool searches for the Dart SDK location in your PATH.

If it fails to locate the SDK there, here is the list of all places used to locate the SDK (in that particular order):

  1. --sdk-path CLI option (if present)
  2. the DCM_SDK_PATH env variable (if present)
  3. the FLUTTER_ROOT env variable (if present)
  4. fvm configuration
  5. .dart_tool/package_config.json
  6. which flutter / where flutter (depending on the platform)

These steps cover most popular ways of installing Flutter (manually, via fvm, asdf or other similar tools).

Manually Locating the SDK​

If for some reason the Dart SDK was not located automatically, pass the --sdk-path CLI option with the absolute path to the SDK folder when calling any DCM command (or provide it via the DCM_SDK_PATH env variable).

For a locally installed Flutter SDK, the expected folder is named dart-sdk and is typically located at ...flutter/bin/cache/dart-sdk (where flutter is the Flutter SDK folder). Alternatively, you can run which dart (or an alternative Windows command) and replace /dart with /cache/dart-sdk.

note

If you are setting the path to the Dart SDK manually, consider reaching out to our support team.

We are interested in supporting as many cases as possible to ultimately reduce the need for manual setup to zero.

MCP Server​

To use MCP tooling (e.g. AI-assisted fixes) alongside Zed, you can run the separate DCM MCP server (dcm start-mcp-server) with an MCP-compatible client. Check out our doc for DCM MCP Server integration.

Support & Feedback​

Because this integration is community-driven:

  • File issues and feature requests at the repository: Extension Repo
  • For core DCM questions (rules, metrics, licensing), contact official channels: Discord