-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add new R extension quickpick to select an interpreter #6213
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 7a31d94.
Signed-off-by: Julia Silge <julia.silge@gmail.com>
E2E Tests 🚀 |
export enum RRuntimeSource { | ||
system = 'System', | ||
user = 'User', | ||
homebrew = 'Homebrew', |
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.
I added this enum to use here and also in the quickpick, for display purposes.
|
||
// R discovery is fast so we just do it before rendering the quick pick | ||
const runtimePicks: RuntimeQuickPickItem[] = []; | ||
const discoverer = rRuntimeDiscoverer(); |
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.
Setting up the quickpick triggers discovery again. Since this is so fast for R, I think this will be more aligned with folks' expectations than a not-entirely-prominent refresh button.
|
||
// If we did in fact get a runtime from the user, select and start it | ||
if (runtime) { | ||
const registeredRuntimes = await positron.runtime.getRegisteredRuntimes(); |
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.
Instead of getting all the registered runtimes and checking whether ours is in it, we could just always re-register the selected one? I don't think it generates errors to register a runtime again.
Let's run the console tests since this command is used here: |
Addresses #5223
We do have a language agnostic way to generate this kind of feature, as implemented in #3213, but our experience with the "Python: Select Interpreter" command highlights that making these language specific is pretty helpful.
What this PR gets us for R (beyond the existing functionality) now is:
What we could add in the future includes:
Related to the upcoming multiple sessions work and changes to the interpreter dropdown, we'll need to add to the Positron API for extensions so that extensions can say, "Here is my command to select an interpreter", and we can use
r.selectInterpreter
together withpython.setInterpreter
. cc @dhruvisompuraLet's run the @:console tests.
Release Notes
New Features
Bug Fixes
QA Notes
brew install r
.When you are done, do
brew uninstall r
because you certainly do not want that R brew installation hanging around. 😆