Skip to content
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

Set default (or persist previous) language for a project #4028

Closed
andrewheiss opened this issue Jul 16, 2024 · 8 comments
Closed

Set default (or persist previous) language for a project #4028

andrewheiss opened this issue Jul 16, 2024 · 8 comments
Labels
area: core Issues related to Core category. area: runtimes Issues related to Language Runtimes enhancement New feature or request

Comments

@andrewheiss
Copy link

Related to #4011 and #3575, a feature that lets users set the default language interpreter for a project could be nice. I keep finding that when I open R-only projects, the R and Python terminals both start up (which is fine), but 90% of the time, the Python console remains active and I have to switch it in the Console pane (either manually or by executing a line of R code from the editor).

For instance, here I have a folder named positron-r that contains test.R. When I start Positron, the Python console is active. I can switch it just fine, but the switch isn't persistent.

positron-python.mov

I'm looking ahead to eventually teaching with Positron and I worry that having the Python console consistently open will confuse new R students.

@andrewheiss andrewheiss added the enhancement New feature or request label Jul 16, 2024
@jennybc
Copy link
Member

jennybc commented Jul 16, 2024

Loosely related to my sense that we need a way, externally and internally, to detect or declare whether something is an R project or a Python project, where these are not mutually exclusive, which is somewhat related to #2637.

@MikeJohnPage
Copy link

Could positron use a .positron file in the root of the project folder to store this information, similar to .Rproj.user?

@andrewheiss as a temporary work-around, I've found that if the incorrect interpreter is started, if it is immediately shut down, it does not restart next time the project is opened.

@jennybc
Copy link
Member

jennybc commented Jul 16, 2024

Could positron use a .positron file in the root of the project folder to store this information, similar to .Rproj.user?

Side comment: I think what you really mean is the .Rproj file, not .Rproj.user. But I know what you're getting at.

There have been internal discussions along the way about having such a file, which is also quite advantageous for project discovery/access via tools like Alfred. But the current thinking is that Positron will not necessarily place a file or folder along these lines.

@MikeJohnPage
Copy link

Sorry, yes you are quite right, that is what I meant :)

Perhaps a simpler solution is for Positron to just expose a workspace setting?

@jennybc
Copy link
Member

jennybc commented Jul 16, 2024

Well, yes, if you set any workspace-specific configuration, it will cause a .vscode/settings.json to appear in the folder. But at this point we are not committed to necessarily, i.e. always, placing such a file.

@andrewheiss
Copy link
Author

andrewheiss commented Jul 16, 2024

Does (or could?) Positron have an exposed setting for a default interpreter, similar to "python.defaultInterpreterPath"? It could be included either in .vscode/settings.json or in a workspace file like whatever.code-workspace, and then be project-specific

image

@jmcphers
Copy link
Collaborator

I keep finding that when I open R-only projects, the R and Python terminals both start up (which is fine), but 90% of the time, the Python console remains active and I have to switch it in the Console pane (either manually or by executing a line of R code from the editor).

We do plan to make this better (independent of any work to let you specify the default interpreter in a settings file). It's tracked in #1044 and #3432.

@juliasilge juliasilge added area: core Issues related to Core category. area: runtimes Issues related to Language Runtimes labels Jul 16, 2024
@juliasilge
Copy link
Contributor

We believe this request is covered in #1044 and #3432.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to Core category. area: runtimes Issues related to Language Runtimes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants