-
Notifications
You must be signed in to change notification settings - Fork 101
Python: Immediately start a Python runtime in Python workspaces #1282
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
Comments
Related to a request for R in #72 |
Some activation events from the python extension include:
|
We may be able to remove this hack once the Python extension accepts responsibility for starting Python when appropriate: positron/src/vs/workbench/services/languageRuntime/common/languageRuntime.ts Lines 459 to 482 in 707042f
|
@jmcphers I need to do some more testing to see whether activating eagerly actually brings Python into the discovery phase, I'd like to track that in #1009. Until then, I think a good step for this issue for alpha would be:
That way, R won't be started at all in folders that only contain Python files, and vice versa, until we figure out #1009. I've got branches of What do you think? I also foresee a separate/related issue by looking at the code, but I haven't tested yet: I'm not sure how Positron will currently react to multiple languages registering a runtime with immediate startup behavior (EDIT: all within the discovery phase). IIUC it would start whichever language happened to positron/src/vs/workbench/services/languageRuntime/common/languageRuntime.ts Lines 503 to 509 in a4ad542
|
Only start an R runtime immediately if the workspace contains R files, or if it's empty but the user has installed RStudio. This is less likely to incorrectly start R in Python projects for users that happen to have RStudio installed. See #1282 (comment) for more detail.
I think |
This is ready for review in 2023.09.0-139. It's worth testing in both R and Python projects. Note that this should only affect opening new workspaces |
No longer needed since we've addressed #1282.
No longer needed since we've addressed #1282.
I just spent some time testing this out with build 139. I have used RStudio as my IDE for... everything 😆 for a while now so it was a pretty good way to explore it.
|
Thank you @juliasilge! Re your 3rd point: Positron doesn't currently support starting more than one runtime with immediate startup behavior. Atm it will only start the first "immediate" runtime registered, which is most often R (since it registers much faster than Python). I think we'd need to file that as a separate feature request/bug if it's something we think is important. Perhaps we want to start at most one runtime per language instead of globally, as it currently is. Given that, I'm surprised that Python started even though there was a |
If we don't add |
@juliasilge great, I agree. In that case, are you happy with us closing this as "done" or is there still anything outstanding? |
Yes! From my perspective, looks great. 👍 |
…startup behavior Merge pull request #212 from posit-dev/immediate-startup heuristically set immediate startup behavior -------------------- Commit message for posit-dev/positron-python@a2f48a5: add conda files to startup heuristic -------------------- Commit message for posit-dev/positron-python@b788426: Update src/client/positron/provider.ts Co-authored-by: Isabel Zimmerman <54685329+isabelizimm@users.noreply.github.com> -------------------- Commit message for posit-dev/positron-python@0a7f647: heuristically set immediate startup behavior Set startup behavior to immediate if the workspace contains files relevant to Python development. Addresses #1282. Note that this branch won't work as expected until #1289 is merged. Authored-by: Wasim Lorgat <mwlorgat@gmail.com> Signed-off-by: Wasim Lorgat <mwlorgat@gmail.com>
…ristic Merge pull request #214 from posit-dev/immediate-startup refine immediate startup heuristic -------------------- Commit message for posit-dev/positron-python@2a5a988: refine immediate startup heuristic Restrict config files to the workspace root. See this discussion for more: #1289 (comment). Also fixes the `.venv` and `.conda` cases which were incorrectly searching for files with those names instead of folders. Relates to #1282. Authored-by: Wasim Lorgat <mwlorgat@gmail.com> Signed-off-by: Wasim Lorgat <mwlorgat@gmail.com>
…startup behavior Merge pull request #212 from posit-dev/immediate-startup heuristically set immediate startup behavior -------------------- Commit message for posit-dev/positron-python@a2f48a5: add conda files to startup heuristic -------------------- Commit message for posit-dev/positron-python@b788426: Update src/client/positron/provider.ts Co-authored-by: Isabel Zimmerman <54685329+isabelizimm@users.noreply.github.com> -------------------- Commit message for posit-dev/positron-python@0a7f647: heuristically set immediate startup behavior Set startup behavior to immediate if the workspace contains files relevant to Python development. Addresses #1282. Note that this branch won't work as expected until #1289 is merged. Authored-by: Wasim Lorgat <mwlorgat@gmail.com> Signed-off-by: Wasim Lorgat <mwlorgat@gmail.com>
…ristic Merge pull request #214 from posit-dev/immediate-startup refine immediate startup heuristic -------------------- Commit message for posit-dev/positron-python@2a5a988: refine immediate startup heuristic Restrict config files to the workspace root. See this discussion for more: #1289 (comment). Also fixes the `.venv` and `.conda` cases which were incorrectly searching for files with those names instead of folders. Relates to #1282. Authored-by: Wasim Lorgat <mwlorgat@gmail.com> Signed-off-by: Wasim Lorgat <mwlorgat@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Via @petetronic:
The text was updated successfully, but these errors were encountered: