-
Notifications
You must be signed in to change notification settings - Fork 91
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
Quarto: 'Execute Current Statement' feature in Quarto chunks #1646
Comments
Related to #1518. |
Would Quarto "fake" a document corresponding to the current code chunk for the provider to parse? I've been wondering if we need some kind of alternative API that takes a string containing the contents of the "document" along with a position, so you don't have to come up with a document URI yourself |
That's more or less exactly what the request forwarding technique does. It creates a virtual document with its own URI that contains the original document but with all unrelated code replaced with whitespace. E.g. from the link above:
Quarto is already generating these virtual documents in its VS Code extension: https://github.com/quarto-dev/quarto/blob/main/apps/vscode/src/vdoc/vdoc.ts |
Came up in beta feedback: https://github.com/posit-dev/positron-beta/discussions/71 |
We did most of this in #3107 and quarto-dev/quarto#436 but have some remaining thoughts to work through:
|
My brain would be happiest with:
The thing I am trying to avoid is using cmd+enter for line execution in my .py file while defining helper functions, then going to my python .qmd file in the same project and suddenly cmd+enter runs a whole cell. |
+1 to what Jeremy said about Cmd+Enter in Python. For executing an entire cell, I would want Shift+Enter to do that, and move to the next cell, as it does in Jupyter UIs. |
Hello, what if we use I asked similar question here: #2778 (comment) For the most part, There are some caveats though, if the language is python, pressing |
After several hours digging on how to best work with R and Python in However, with Quarto document it is very disappointed. I cannot wrap my head on how complex the situations are:
I agree with Jeremy that the experience must be the same for every file type. Or at least with me, I only need |
Thanks for sharing this feedback @ntluong95! You are describing the remaining work as outlined in #1646 (comment)
|
I have a new version of the Quarto extension ready to go to, for improved behavior here. You can currently get this as an artifact here (download the artifact, unzip, install the QA NotesWe can test out the new, improved behavior with two The other item we were tracking in this issue was improvements to reticulate (R + Python) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Verified Fixed
Test scenario(s)Able to "step through" QMD cells in R and python properly after some local system clean up. Link(s) to TestRail test cases run or created: |
Currently, Quarto takes over Cmd+Enter to execute code inside Quarto chunks. Consequently our statement detection logic doesn't work in Quarto, and if you don't have a selection, it just sends one line at a time to the Positron console.
We could implement Execute Current Statement for Quarto by using the statement range providers to detect a region for execution. This could be accomplished using the request forwarding technique along with a new command called e.g.
positron.executeStatementRangeProvider
. This has the advantage of putting Quarto in charge of cursor movement and code execution, in case it wants to do anything special (UI decoration, wrapping inreticulate
, etc.)Another approach would be to implement a higher-level command Quarto could call to have Positron handle invocation of the providers and code execution; Quarto would just trigger it with the cursor position and let the command do the rest.
The text was updated successfully, but these errors were encountered: