Open
Conversation
4611c2c to
dbb841c
Compare
1c89d9f to
caa4f79
Compare
caa4f79 to
8b245aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
QA Notes
This is comprehensively tested on the backend side.
Expressions in the watch pane should be sensitive to selected frame, and should update at each step.
Expressions evaluate to the same kind of object as in the variable pane. Complex values are expandable.
By prefixing with the slash command
/print, you can get the printed output, e.g./print mtcars. Truncated but full output available on hover.Watch expressions at top-level browser (e.g.
browser()called directly) should evaluate in the global environment.Invalid expressions should show error messages.