-
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
Provide "Select Interpreter" for R (similar to Python) #5223
Comments
Is this also including virtual environment created by renv? |
In my head, the renv matter is filed in a slightly different folder. I think we should be able to discover the use of renv and act more appropriately. So that feels related, but no, not exactly what this issue is about. (I don't see an issue that really captures the renv case crisply, so perhaps I should do something about that.) |
In today's R meeting, I got folks to discuss the "why" of bringing the Python "Select interpreter" experience over to R. Because the facts on the ground tend to be very different, i.e. we aren't crawling the file system looking for R installations or environments. Some of what such an interface can deliver:
|
…5648) Addresses #1397 Addresses #5220 Continued preparation for #5223 A lot of the changes are very internal, but there are also user-facing improvements: * Even more effort to track the reasons (plural) why we've discovered an R installation and, perhaps, the reason an R installation can't be used with Positron. The richer information appears in the Positron R Extension output channel. * If we discover at least one R installations, but there is no usable R installation, we put a pop-up warning. The exact details of this will be good to discuss in the next R meeting. ### QA Notes To experience this, you need to have at least 1 unusable R installation around and 0 usable ones. For rig-installed R, use `rig rm release` (or similar) to remove an R installation. Repeat as necessary, until all usable R is gone! Older R installers are here for macOS arm64: https://cran.rstudio.com/bin/macosx/big-sur-arm64/base/. This makes it easy to get R 4.1, for example, which is below our minimum supported version. You should see a modal telling you that all R installations are unusable, allowing you to look at the Positron R Extension output channel or dismiss. --------- Signed-off-by: Jennifer (Jenny) Bryan <[email protected]> Co-authored-by: Chris Mead <[email protected]> Co-authored-by: Julia Silge <[email protected]>
Turns out that we mostly already have this: We do this by bouncing the command back to Positron itself: positron/extensions/positron-r/src/commands.ts Lines 159 to 161 in f4b7966
Search works ✅ and you can see the whole path ✅ Still TODO:
|
There are downsides to having this in Positron itself, as a language runtime action:
I am leaning toward implementing a more R-specific version of the quickpick in the R extension itself. If I do that, is there benefit to keeping the generic runtime command around, for possible future other language packs? If refreshing is an important part of this UI (and remember we have no other way to let users refresh discovery), then we'll probably always want this kind of functionality in language packs. |
I think it makes the most sense for individual languages to implement interpreter selectors since (as you noted) there are often nuances or details specific to a language that make it difficult to build a generic UI that will serve everyone. It would be helpful for there to be some sort of workflow for re-initiating discovery for a language that was driven from the Positron side, but I don't think that needs to happen here. R discovery is so fast that we could probably even do it to build the quickpick, and if the user chooses a version of R that wasn't in the set we initially delivered to Positron, we can do a just-in-time registration. The generic interpreter selection command isn't that useful for end users, but I think it's helpful to us as a debugging tool and as a stable way of picking interpreters in test automation. |
The So overall what that means is that the only thing we're really gaining at the current moment is to initiate discovery. Probably still worth doing (given that I almost have it finished), but not a huge win over the existing language agnostic |
The Python extension has a nice "Select Interpreter" UI experience with a quick pick, and in some situations, it is more useful and nicer than Positron's interpreter dropdown:
It is easier to see the paths, you can search, you can refresh, etc.
Let's create the equivalent experience for R interpreters as a first step. In the longer term, we may want to reconsider what each of these affordances are best suited for.
The text was updated successfully, but these errors were encountered: