Repository navigation
route rmd chunk execution through the focused editor view - #18521
Conversation
Assign a stable automation/styling class (rstudio_editor_split_view) to the secondary editor view, so tests and tooling can tell the two views of a document apart without probing rendered text.
Run Current Chunk, Run Next Chunk, and Run Previous/Subsequent Chunks resolved the target chunk against the primary view's cursor, so with a split editor focused they ran the wrong chunk. Resolve chunk positions from the active view instead (positions are document-wide, so the primary view's scope tree can still service them), and land cursor and scroll feedback in the view that initiated the execution. Run Line inside a chunk also bypassed the notebook queue when initiated from the split view: the inline-chunk-output flag lives on each editor view and was never applied to the split, so execution fell through to the console. Sync the flag to the split view at creation and whenever the notebook changes the output mode.
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
Code review findingsActionable items from an automated review of this PR's diff. Important
Suggestions
|
- withVisualModeSelection now reads the source-mode cursor from the active editor view, so Run Previous/Subsequent Chunks resolve from the split view when it holds the cursor - executeSweaveChunk records the executed range on the initiating view's executor, so Re-Run Previous re-runs the chunk it just ran instead of that executor's older range - drop the unused no-arg scope-helper variants, which silently read the primary view's selection
- clear console state before focusing the views, so the Run Line keypress is actually delivered to the focused split editor - wait for the async chunk toolbars before capturing the line-widget baselines - use a unique file per test: reopening a path whose content matches a previously executed notebook restores its cached output widgets - add a regression test for Run All Chunks Above from the split view - fix tsc errors (gotoLine arity, element handle typing)
|
Thanks -- all five were on target, applied in 5bed5a7 and 24b78d1.
|
When a document's editor is split (#2129, added in #18460), several R Markdown chunk-execution paths ignored which view held the cursor:
This PR resolves chunk positions from the focused view (positions are document-wide, so the primary view's scope tree can still service them), lands cursor/scroll feedback in the view that initiated the execution, and keeps the split view's inline-output flag in sync -- at split creation, and whenever the notebook changes the output mode.
It also assigns a stable class (
rstudio_editor_split_view, viaClassIds) to the split editor view so automation and styling can tell the two views of a document apart; the new Playwright suite uses it.Chunk output widgets and chunk toolbars still render only in the primary view's session; fanning those out to every view is tracked as follow-up work.
Includes a Playwright regression suite (
split_editor_rmd.test.ts) covering both execution paths.Addresses #2129.