Skip to main content

Cursor Extension

note

The DCM Cursor integration is fairly similar to VS Code integration.

To get real-time display of analysis errors in your IDE, install the DCM extension.

To install the extension, open the Cursor Extensions view and search for DCM or install it from Open VSX Registry.

Cursor DCM Extension

Extension Capabilities​

All the analysis issues reported by DCM are surfaced in real time inside your opened files and displayed in the Problems panel.

Cursor Problem Panel

You can trigger auto-fixes directly from suggested AI quick actions or standard Cursor code actions.

Cursor DCM Quick AI Action

Use the β€œDCM: Fix All Auto-fixable Problems” command to automatically resolve issues across your project. (You can set a shortcut, for example: ⌘ + Shift + S.)

Cursor DCM Auto Fix All

To apply fixes automatically on save, add this configuration in .cursor/settings.json:

.cursor/settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.dcm.fixAll": "explicit"
// or, to enable unsafe fixes on save,
// "source.dcm.unsafeFixAll": "explicit",
}
}

MCP Server​

To enable the DCM MCP Server in Cursor, refer to this guide.

Analysis Options Files​

If your analysis_options.yaml file is open, the extension will mark all rules that support additional config with βš™οΈ icon.

You can also call the code action menu on each rule to quickly change its severity, disable it or open the rule documentation.

Cursor DCM Config

Custom Analysis Configurations​

Aside from the regular analysis_options.yaml file, you can add a custom config file that matches one of the given patterns:

  • start with analysis_options (e.g. analysis_options.1.1.0.yaml)
  • start with dcm (e.g. dcm_config.yaml, dcm.yaml)
  • placed inside a dcm/ folder (e.g. dcm/config.yaml)

If such a file is referenced by any analysis_options.yaml file, DCM will correctly update configuration changes, validate rule names and display a configuration icon (βš™οΈ) for configurable rules.

However, unlike for regular analysis_options.yaml files, code actions are not available.

Enabling Autocompletion​

Cursor, like VS Code, treats .yaml content as plain text and does not provide autocompletion by default.

To enable autocompletion for DCM configuration (and also for the Dart configuration and pubspec files), modify the settings.json to the following:

.cursor/settings.json
{
"[yaml]": {
"editor.quickSuggestions": {
"strings": "on"
}
}
}

Available Commands​

  1. > DCM: Restart Analysis Server
  2. > DCM: Activate License Key
  3. > DCM: Share Feedback
  4. > DCM: Capture All Logs
  5. > DCM: Open Extension Log
  6. > DCM: Fix All Auto-fixable Problems
  7. > DCM: Format Current File
  8. > DCM: Show Issues From Baseline
  9. > DCM: Hide Issues From Baseline
  10. > DCM: Show / Hide Unused Code Issues
  11. > DCM: Show / Hide Unused File Issues
  12. > DCM: Open Rules Page
  13. > DCM: Open Metrics Page

Cursor DCM Config

Configuration Options​

  1. Dart SDK Path - is detected automatically if listed in PATH, but can be set up explicitly, if another version of the SDK should be used. FVM is also supported, if the project has a .fvm/flutter_sdk symlink - it will be used by the extension as well.
  2. DCM Executable Path - is detected automatically if listed in PATH, but can be set up explicitly.
  3. Show New Version - show a notification when there is a new DCM version available.
  4. Show Unused Code - show unused code in the IDE (exclude-public-api is currently not supported).
  5. Show Unused Files - show unused files in the IDE (exclude-public-api is currently not supported).
  6. Disable Baseline - disable baseline and show ignored issues in the IDE.
  7. Enable Old Formatter - enable pre-Dart 3.7 formatter.

Inherited Configuration​

The following configuration gets picked up if set for the Dart extension

  1. "dart.analysisExcludedFolders"
  2. "dart.onlyAnalyzeProjectsWithOpenFiles"

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.

Locating Extension Logs​

To find the extension logs, use the > DCM: Open Extension Log IDE command (to collect all logs, use the > DCM: Capture All Logs before opening the logs file).

To find exceptions produced by the extension, go to View -> Output (or open the Output tab, which is located next to the Problem tab), and then select DCMLSP (if present) from the drop-down list on the right.

Ensuring the Entire Team Installs the IDE Extension​

To ensure that your entire team installs the DCM Cursor extension, configure the "Workspace recommended extensions".

extensions.json
{
"recommendations": ["dcmdev.dcm-vscode-extension"]
}

Enabling Inline Diagnostics​

To have diagnostics appear as text at the end of the line, consider installing an additional IDE extension (for example, Error Lens).

warning

Make sure the installed third-party extension is not malicious. We are not liable for any damage caused by third-party extensions.

Changelog​

See Changelog for Cursor-specific DCM updates.