Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Branched from #1033 (for DAP tests)
Addresses posit-dev/positron#1765
Adds support for evaluating expressions from the debug watch pane via DAP
evaluaterequests. One such request is sent for every watch expression.Since we're asynchronously getting these requests, and R might no longer be idle at that time, the
evaluaterequests run as idle tasks (see #371) that only run once R is safely idle (waiting inReadConsole). The regular idle tasks spawned withspawn_idle()do not run when the debugger is active. This is the safe default for general purpose tasks, but forevaluaterequests we obviously need them to run when R is paused. I've introducedspawn_idle_any()for tasks that also need to run at debug prompts.Also adds infrastructure for capturing console output during idle tasks processing
evaluaterequests. This way the output is logged at info level instead of being emitted as orphaned IOPub streams.I've also added support for printing in the watch pane by prefixing the expression with
print. In that case we return the captured output instead of the object. That doesn't work that well though because you need to hover to see the captured outpub. This feature is almost free though so I kept it.Screen.Recording.2026-02-10.at.16.01.09.mov