Bring this extension to a point where Dart and Flutter applications can be debugged reliably in Zed, including practical access to Flutter DevTools.
Testing is a first-class requirement for this work.
- Every phase must include unit and integration coverage appropriate to the change.
- No debugger behavior change should merge without regression coverage for the affected config or workflow.
- Testing is not a final polish step. It is part of the definition of done for each phase.
- The extension already starts the Dart/Flutter DAP via
dart debug_adapter/flutter debug_adapter. - Debugging support is implemented only through
get_dap_binaryanddap_request_kind. - The extension does not implement Zed's newer debug scenario or debug locator APIs.
- DevTools integration is not implemented.
- Windows debug config uses the tool binary name as the DAP
type, which is incorrect forflutter.bat/dart.bat. stopOnEntryis ignored and forced tofalse.flutterModeis hardcoded todebug.vmServiceUrihandling is incomplete for attach flows.device_idis not translated into Flutter tool arguments like-d <device>.- FVM tasks are malformed because they use
command = "fvm flutter"instead ofcommand = "fvm"plus args.
- No debug locators are registered, so tasks are not converted into debug sessions automatically.
- No scenario generation exists for Zed's newer debugger UI.
- No hot reload or hot restart support in the extension itself.
- No DevTools launch or URL surfacing support.
- No automated test coverage for debug config generation or runnable-to-debug resolution.
- Local verification in this workspace is limited because
cargois not installed here.
zed-extensions/dart#64: attach debugger failureszed-extensions/dart#45: rerun session issueszed-extensions/dart#50: Flutter debugger maturity concernszed-extensions/dart#66: baseline debug config fixeszed-extensions/dart#72: hot reload and hot restart custom actionszed-industries/zed#51873: Zed-side custom debug actions API
The roadmap should be driven by the current open issues that affect debugger usefulness in real projects.
These issues define the first major debugger milestone for this fork:
zed-extensions/dart#64: attach debugger failureszed-extensions/dart#45: rerun session instabilityzed-extensions/dart#50: Flutter debugger maturity and missing practical workflowszed-extensions/dart#33: nested-module and non-rootpubspec.yamlworkflowszed-extensions/dart#63: hot reload on save
#64means attach must be treated as a first-class workflow, not an optional follow-up.#45means rerun-session stability needs explicit regression testing.#50confirms that current debugging is incomplete even when basic breakpoint support works.#33meanscwd, nested modules, and project-root resolution must be covered early in integration testing.#63confirms that save-triggered hot reload is an expected Flutter workflow.
- Add VS Code-style interactive Flutter device selection rather than relying only on manual
device_idconfiguration.
zed-extensions/dart#77: LSP initialization failureszed-extensions/dart#53: inconsistent run indicators
These are not the primary debugger deliverables, but they affect the perceived quality and reliability of the debugging experience.
The following should not drive the debugger implementation directly:
- completion behavior issues
- syntax highlighting issues
- outline and breadcrumb improvements
- dartdoc support
- closing labels
- test/implementation-file navigation
- line-length default handling
#66is a good base patch and still appears applicable.- It fixes the most obvious correctness problems in:
src/dart.rsdebug_adapter_schemas/Dart.jsonlanguages/dart/tasks.json
- It should not be treated as the final solution because it still does not fully address device selection, locators, or DevTools.
The first major milestone for this fork is:
- stable launch support
- stable attach support
- stable rerun-session behavior
- working nested-module and non-root
pubspec.yamlworkflows - explicit and reliable device targeting, with a path to interactive device selection
- a credible path toward hot reload support
This milestone is considered complete only when the issue set above is addressed well enough that Dart and Flutter debugging is usable in normal day-to-day development, not just in ideal demo setups.
- Dart launch works in standard projects.
- Flutter launch works with explicit device targeting.
- Device selection is reliable for configured launches, and the roadmap includes interactive device selection as the next usability step.
- Attach works against a running Flutter app.
- Rerun works repeatedly within the same session.
- Nested-module projects work with correct
cwdand root resolution. - Integration fixtures cover at least one Dart project and one Flutter project.
- Regression tests exist for launch, attach, rerun, and nested-module handling.
Apply the equivalent of upstream #66 to this fork.
Scope:
- Fix Windows DAP
typehandling. - Respect
stopOnEntry. - Make
flutterModeconfigurable. - Add
toolArgs. - Add
env. - Avoid sending
vmServiceUriwhen absent. - Enable adapter log forwarding to Zed.
- Fix FVM task definitions.
Testing requirements:
- Add unit tests for debug config serialization.
- Add unit tests for
dap_request_kind. - Add regression tests for:
- Windows
typehandling stopOnEntryflutterModetoolArgsenv- absent vs present
vmServiceUri - FVM task shape
- Windows
Exit criteria:
- Launch works on Windows, macOS, and Linux for basic Dart and Flutter configs.
- FVM-backed tasks invoke correctly.
- Core config generation behavior is covered by unit tests.
Improve how Flutter launches are constructed.
Scope:
- Convert
device_idinto effective Flutter tool args such as-d <device>. - Support common Flutter launch variants through config:
- flavors
- web server targets
- emulator and physical device IDs
- profile and release modes where appropriate
- Normalize
cwdbehavior for multi-module workspaces.
Testing requirements:
- Add unit tests for device and tool argument generation.
- Add integration-style verification against at least one sample Flutter project.
- Add regression coverage for multi-module
cwdresolution.
Exit criteria:
- Flutter launches target the requested device deterministically.
- Common real-world project layouts can be launched without manual command rewriting.
- Launch argument construction is covered by tests.
Adopt Zed's scenario and locator APIs.
Scope:
- Register a debug locator in
extension.toml. - Implement:
dap_config_to_scenariodap_locator_create_scenariorun_dap_locator
- Map runnable tasks into debug sessions for Dart and Flutter entrypoints.
Testing requirements:
- Add unit tests for scenario generation from generic debug configs.
- Add unit tests for locator acceptance and rejection behavior.
- Add integration-style coverage that exercises runnable-to-debug conversion for:
- Dart entrypoints
- Flutter entrypoints
- test tasks where supported
Exit criteria:
- Users can start debug sessions from run tasks and newer debugger UI flows.
- Manual
.zed/debug.jsonremains supported, but is no longer the only path. - Scenario and locator logic are covered by tests.
Target known debugger reliability problems.
Scope:
- Fix attach behavior around
vmServiceUri. - Verify accepted URI formats and normalize where necessary.
- Investigate rerun-session failures and ensure repeat launches behave consistently.
- Add explicit logging around adapter startup and attach resolution.
Testing requirements:
- Add unit tests for
vmServiceUrinormalization and attach config generation. - Add integration-style verification against a running sample app for attach.
- Add regression coverage for rerun behavior where it can be simulated or validated through scripted workflows.
Exit criteria:
- Attach to a running Flutter app works reliably.
- Rerun session works more than once per project session.
- Attach and rerun changes are backed by regression coverage.
Add a first-class device-selection workflow for Flutter launches.
Scope:
- Discover devices using Flutter's machine-readable device listing.
- Surface selectable devices through the extension flow instead of requiring users to hand-edit
device_id. - Carry the selected device into generated debug scenarios and launch configs.
- Preserve manual
device_idconfiguration as an override path.
Testing requirements:
- Add unit tests for device-list parsing and scenario generation using selected devices.
- Add integration-style verification with at least two device targets where feasible, such as
chromeplus one desktop/mobile target. - Add regression coverage ensuring manual
device_idstill overrides defaults when explicitly provided.
Exit criteria:
- Users can choose a Flutter device without editing raw config.
- Generated launch configs use the selected device consistently.
- Manual device configuration continues to work.
Adopt extension-declared debug actions once supported by Zed.
Scope:
- Add custom debug actions for:
- hot reload
- hot restart
- Hook reload to save events where appropriate.
- Rebase any implementation on top of the baseline fixes from Phase 1.
Dependency:
- Zed support for extension custom debug actions, tracked in
zed-industries/zed#51873.
Testing requirements:
- Add integration-style verification for toolbar-triggered reload and restart.
- Add regression coverage for save-triggered reload behavior.
- Validate behavior against a sample Flutter application where state preservation can be observed.
Exit criteria:
- Flutter sessions expose hot reload and hot restart in Zed.
- Save-triggered reload works when enabled.
- Hot reload and hot restart behavior are covered by automated checks where feasible and by documented integration verification.
Provide a practical DevTools workflow.
Short-term target:
- Surface the DevTools URL in debug output.
- Add a command or action to open DevTools in the browser for the active VM service.
Medium-term target:
- If Zed gains extension webview or panel support suitable for this, evaluate embedded DevTools.
Notes:
- Browser-based DevTools launch is the pragmatic target today.
- Embedded DevTools likely depends on Zed platform capabilities beyond this extension.
Testing requirements:
- Add unit tests for DevTools URL construction from VM service data.
- Add integration-style verification that an active Flutter debug session exposes a usable DevTools launch path.
Exit criteria:
- A running Flutter debug session exposes a one-step path to open DevTools.
- DevTools launch behavior is covered by tests and scripted verification.
Consolidate and expand the testing strategy so future debugger work remains stable.
Scope:
- Fill remaining unit-test gaps.
- Build reusable integration fixtures for Dart and Flutter sample apps.
- Add CI coverage for the extension test suite.
- Add manual verification docs for:
- Dart CLI apps
- Flutter mobile
- Flutter web
- launch
- attach
- rerun
- hot reload
- hot restart
- DevTools launch
Exit criteria:
- Debugging changes can be validated without relying only on ad hoc manual testing.
- CI and local verification cover the most failure-prone debugger workflows.
- Baseline fixes from
#66 - Flutter launch and device selection cleanup
- Zed debug scenarios and locators
- Attach and rerun stabilization
- Interactive device selection
- Hot reload and hot restart
- DevTools launch support
- Test coverage and polish
Start by implementing the equivalent of #66 in this fork, but extend it so Flutter device_id becomes effective tool arguments. That gives a stable base for the larger debugging roadmap and avoids building DevTools support on top of a fragile launch layer.
- No phase is complete without the tests listed in that phase.
- Unit tests should cover config generation, scenario conversion, and normalization logic.
- Integration tests should cover launch, attach, rerun, reload, restart, and DevTools access as the features land.
- When full automation is not feasible, add scripted verification steps and sample fixtures immediately, then automate them as tooling allows.