
lifecycle::badge("experimental")
RStudio
Addin:
Extracts file name and (possibly) line number of a test file
from a selection or from clipboard content.
Navigates to the file and places the cursor at the line number.
Supported types of strings: "test_x.R:3"
, "test_x.R#3"
, "test_x.R"
.
The string must start with "test_"
and contain ".R"
.
It is split at either ":"
or "#"
, with the second element (here "3"
) being
interpreted as the line number.
See `Details`
for how to set a key command.
navigateTestFileAddin(selection = NULL, navigate = TRUE, abs_path = TRUE)
Navigates to file and line number.
Does not return anything.
String with file name and line number. (Character)
E.g. "test_x.R:3:"
, which navigates to the third line of "/tests/testthat/test_x.R"
.
N.B. Mainly intended for testing the addin programmatically.
Whether to navigate to the file or return the extracted file name and line number. (Logical)
N.B. Mainly intended for testing the addin programmatically.
Whether to return the full path or only the file name when `navigate`
is FALSE
.
N.B. Mainly intended for testing the addin programmatically.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts
.
Find "Go To Test File"
and press its field under Shortcut
.
Press desired key command, e.g. Alt+N
.
Press Apply
.
Press Execute
.
Other addins:
assertCollectionAddin()
,
dputSelectedAddin()
,
initializeGXSFunctionAddin()
,
initializeTestthatAddin()
,
insertExpectationsAddin()
,
wrapStringAddin()