Repository navigation
use new rmarkdown's 'output_source' - #701
Merged
Merged
Conversation
kevinushey
force-pushed
the
feature/notebook-output-source
branch
from
May 11, 2016 18:54
6b2dae9 to
e864e9f
Compare
Member
|
LGTM. Feel free to merge once you've done the additional testing you want to. The last commit in rmarkdown is a version bump so we should be good to go there. |
kevinushey
added a commit
that referenced
this pull request
May 26, 2026
The basename-only readiness check could match the wrong active document when two open files share a basename (or, on case-sensitive filesystems, differ only in case). When the caller passes an absolute path, compare the full normalized path (case-insensitive, slashes normalized) instead. Relative / bare-basename inputs still fall back to basename match -- R resolves them against its own cwd, so the absolute form RStudio reports back is not known to the helper. Addresses roborev review #701 (MEDIUM).
kevinushey
added a commit
that referenced
this pull request
May 26, 2026
* test(e2e): expose active ace editor via automation bridge Adds window.rstudio.documents.activeEditor(), which returns the native Ace JS instance backing the active source document (or null). It maps through SourceColumnManager.getActiveNativeEditor -- the same path the GWT side already uses to track "the active doc" -- so callers no longer have to scan the DOM for a .ace_editor element. The DOM scan in getEditorContent and openExistingFile was the proximate cause of 8 consistent air_formatting test failures: the bare .ace_editor selector also matches ShellWidget's console scroll panel, dialog editors (IgnoreDialog, ViewFileDialog, EditSnippetsDialog, AceEditorPreview), and stale source editors left in the DOM after a tab close -- any of which could shadow the real editor and surface as an empty getValue() in reformatCode. Refactors: - getEditorContent() reads activeEditor()?.getValue() instead of iterating .ace_editor. - New openExistingFile() helper (utils/files.ts) waits on documents.active().path basename match + activeEditor() != null; writeAndOpenFile and SourcePaneActions.createAndOpenFile both delegate to it. - air_formatting.test.ts: openTestFile uses openExistingFile; focusEditor wraps its waitForFunction in a diagnostic catch so a future focus-drift failure reports the actual active element, the in-console / in-source-panel flags, and the source-pane ace count instead of an opaque predicate-timeout. * rename openExistingFile to openFile * openFile: compare full paths when absolute input is given The basename-only readiness check could match the wrong active document when two open files share a basename (or, on case-sensitive filesystems, differ only in case). When the caller passes an absolute path, compare the full normalized path (case-insensitive, slashes normalized) instead. Relative / bare-basename inputs still fall back to basename match -- R resolves them against its own cwd, so the absolute form RStudio reports back is not known to the helper. Addresses roborev review #701 (MEDIUM).
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.
NOTE: hold this PR pending some more testing.
This PR implements cache item injection using the
output_sourcehook provided byrmarkdown. Essentially, a cleaned-up version of the code we were injecting into theevaluatehook has now been moved tooutput_source, and we remove a bunch of unneeded code (as that code has been moved tormarkdown.We should make sure we sync an
rmarkdownversion bump and pin to that before merging this PR.