dart-lang / dart-lang/webdev

Support expression evaluation when running

Open
#1,980 0 comments 0 reactions 0 assignees View on GitHub
eval P3 package:dwds triaged
Dominant language
Dart
Stars
224
Forks
94
Avg merge
4d 3h
Merged PRs (30d)
2

Description

Expression evaluation in a debugger while running is supported currently on other platforms. Investigate what needs to be done to support it in dwds.

- Dart code allows evaluation in a root library when app is not paused, but dart DevTools does not
- Suggestions:
- call `vmService.evaluate()` on root library ID in DevTools if app is not paused.
- See dart-code:
https://github.com/Dart-Code/Dart-Code/blob/aeea8df97ebe3de1c805f7767bd662cb3bc8f895/src/debug/dart_debug_impl.ts#L1576

- dwds does not always give correct root library
- Add root library to ddc metadata (probably in a new app-level metadata section?)

- Question: is it possible to support general eval while running (ie pick/find a library to evaluate in?)
- Should be possible in DevTools, would need UI changes (to pick the library).
- Is it possible to find the library automatically?

**VSCode debugging on MacOS**

image

**VSCode debugging on chrome**

image

Contributor guide

Open the contributing guide

Research direction

Start with the linked dart_debug_impl.ts reference and the vmService.evaluate() suggestion, then trace how dwds determines and exposes the root library through DDC metadata. Determine how DevTools should evaluate while the app is running and whether general evaluation needs library selection. Done means the required scope and behavior are established, including correct root-library handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.