Code mockup for proposal to change workbench.action.positronConsole.executeCode in Positron
#867
+48
−57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #825 I ended up re-implementing Positron internal code (that is used in the source editor) for finding a statement range at the cursor, executing the code in that range, and then finding the next statement range. As @juliasilge brought up, this doesn't seem ideal. Ideally we could use Positron to do the work for us.
At the core, this PR modifies #825 to execute the
"workbench.action.positronConsole.executeCode"command with extrapositionanduriarguments, so that it is suitable for use in a vdoc. It also expects this command to return the position of the next statement range. The result of the code changes are to support the use of this functionality. This is not how this command actually works in Positron today, but let this PR serve as a proposal for how to modify this command to support this functionality (@juliasilge suggested putting up a PR with how I want to use the command so that she can do the work on the Positron side).With this modification, we are able to remove the code that re-implements Positron's internals.