Skip to content

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Feb 10, 2026

Branched from #1033 (for DAP tests)
Addresses posit-dev/positron#1765

Adds support for evaluating expressions from the debug watch pane via DAP evaluate requests. 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 evaluate requests run as idle tasks (see #371) that only run once R is safely idle (waiting in ReadConsole). The regular idle tasks spawned with spawn_idle() do not run when the debugger is active. This is the safe default for general purpose tasks, but for evaluate requests we obviously need them to run when R is paused. I've introduced spawn_idle_any() for tasks that also need to run at debug prompts.

Also adds infrastructure for capturing console output during idle tasks processing evaluate requests. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant