-
Notifications
You must be signed in to change notification settings - Fork 79
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
User configurable R location #5205
Conversation
Continuing to reduce re-discovery and noise in the output channel
registry = 'Windows registry', | ||
/* eslint-disable-next-line @typescript-eslint/naming-convention */ | ||
PATH = 'PATH' | ||
PATH = 'PATH', | ||
user = 'user-specified directory' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just continuing to lay groundwork that will be helpful when tackling #1397.
cachedRBinary = await findRBinaryFromPATH(); | ||
return cachedRBinary; | ||
} | ||
|
||
let cachedRBinaryFromPATH: string | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unrelated improvement. Part of continuing effort to reduce rediscovery and repetition in the output channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a code perspective and how the options are presented to users, this is looking great!
I did just spend a bit of time trying to install R in a non-standard location on my dev machine AND FAILED 😆 so let's get this merged in and available for testing in a broader set of circumstances.
// @kevinushey likes to install R here because it does not require administrator | ||
// privileges to access | ||
'C:\\R', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up @kevinushey: as previously discussed, you can now configure this location via the new positron.r.customRootFolders
configuration point, available in the advanced section of positron-r's settings.
Addresses #2235
Adds 2 configuration points:
positron.r.customRootFolders
is an array. Each entry is a folder that is searched for 1 or more R installations.positron.r.customBinaries
is an array. Each entry is the path to a specific R binary.QA Notes
It's hard to get into a position where this configuration comes into play, because you have to make sure that four methods of automatic discovery won't work. I'm focusing on Windows because that's the main OS that drives the need for this.
C:/nonstandardRLocation/
. Make sure to uncheck the box to write to the registry! If you forget or you're doing this with an existing installation, you can remove the registry keys withC:/nonstandardRLocation/R-4.4.1/bin/x64/RSetReg.exe /U
(note the/U
argument for unsetting keys). All R installations on Windows ship with this executable for setting/unsetting registry keys.rig default 4.3.3
.C:/Program Files/R
nor inC:/Users/<Username>/AppData/Local/Programs/R
Use the command palette to do Preferences: Open Settings. Go to Extensions > R > Positron R Language Pack (advanced) and do each of these, in turn:
C:/nonstandardRLocation/R-4.4.1/bin/x64/R.exe
C:/nonstandardRLocation
Fire up Positron again. Either of these settings should make the nonstandard installation appear in the interpreter dropdown.
Other things that can be noticed in the Positron R output channel:
In the presence of custom binaries, you'll see something like this:
In the presence of a custom root folder, you'll see something like this: