Repository navigation
Support global evaluation in SDK DAPs #4636
Description
Activity
- addedin debuggingRelates to the debug adapter or process of running debug sessionsRelates to the debug adapter or process of running debug sessions
on Jul 10, 2023 - added a commit that references this issue
on Jul 11, 2023 What will it take to support evaluating in the context of the library of the currently open file and/or adding some affordance in the UI to select the library to use?
What will it take to support evaluating in the context of the library of the currently open file
That's actually what we do :) The comment above didn't mention it, but we pass through the active file in the
context(it's non-standard, but all we have for now):Dart-Code/src/extension/providers/debug_adapter_global_evaluation_context_factory.ts
Lines 34 to 39 in 7389b2c
if (message.command === "evaluate" && message.arguments?.context === "repl") { const doc = getActiveRealFileEditor()?.document; if (doc && isDartDocument(doc)) { message.arguments.context = doc?.uri.toString(); } } And then in the debug adapter, we read this and find the relevant library for that script:
There's no UI to allow you to select, it just uses the current file. We could change this, although I don't know how nice the UI would be - but you can always open a specific file if you want to use that library.
What we don't support though is a way to choose the isolate.
- added a commit that references this issue
on Apr 6, 2024
In the old DAPs we supported some basic global evaluation using the root library and the first available isolate. We should support the same in the new SDK DAPs, but ideally use the current open file rather than the root library.