-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationalize navigateToFile()
and documentOpen()
#262
Comments
For some historical context, The main advantage of
I think you're right. For what it's worth, in some cases, we might perform work in |
Yeah I did not even attempt a careful analysis of how rstudioapi behaves against different versions of the IDE. Is that systematically tested in any way or more of a human-curated matter/ |
It feels like
navigateToFile()
andopenDocument()
are basically the same, so I'm left wondering which one I should use.I note that
documentOpen()
has not yet appeared in a released version of rstudioapi, so this can still be rationalized easily.From where I sit, it feels like
documentOpen()
should be a straight call to.rs.api.documentOpen(filePath, line = line, col = col, moveCursor = moveCursor)
. The current call tonormalizePath(path, winslash = "/", mustWork = TRUE)
in this package seems unnecessary given the argument checking and processing inside.rs.api.documentOpen()
.And then maybe
navigateToFile()
becomes just an alias fordocumentOpen()
?documentOpen()
feels like a better name for this operation and fits well into the family ofdocumentVERB()
functions.(
.rs.addApiFunction("navigateToFile")
is just an alias for.rs.api.documentOpen()
at this point.)rstudioapi/R/document-api.R
Lines 246 to 254 in 75e7f6e
rstudioapi/R/stubs.R
Lines 238 to 248 in 942cebe
https://github.com/rstudio/rstudio/blob/91cb63802260d5489b024538b7e04320615b3dfa/src/cpp/r/R/Api.R#L265-L271
https://github.com/rstudio/rstudio/blob/91cb63802260d5489b024538b7e04320615b3dfa/src/cpp/r/R/Api.R#L652-L706
The text was updated successfully, but these errors were encountered: