Skip to content

fix and enhance navigateToFile#430

Merged
renkun-ken merged 2 commits intoREditorSupport:masterfrom
MilesMcBain:master
Oct 27, 2020
Merged

fix and enhance navigateToFile#430
renkun-ken merged 2 commits intoREditorSupport:masterfrom
MilesMcBain:master

Conversation

@MilesMcBain
Copy link
Copy Markdown
Collaborator

What problem did you solve?

  • fix bug in navigateToFile in rstudioapi emulation where positions were being converted to VSCode coordinates twice leading to incorrect position being navigated to (row and column -1).
  • add 'reveal' call so that position row/column is scrolled to in file after opening.

(If you do not have screenshot) How can I check this pull request?

check that in an attached VSCode R session rstudioapi::navigateToFile(file, row, colum) opens a text editor to path in file and scrolls to show the cursor at position line = row, column = column. Does not need to be an .R file.

For example in the VSCode-R project, with an attached R session, rstudioapi::navigateToFile("src/rstudioapi.ts", 154, 23) should navigate to the Typescript definition for navigateToFile.

- fix big where positions were being converted twice
- add 'reveal' so that position or seleciton is scrolled to
  in file
Comment thread src/rstudioapi.ts Outdated
Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works well.

LGTM

@renkun-ken renkun-ken merged commit 63edf49 into REditorSupport:master Oct 27, 2020
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.

2 participants