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

Use Positron's statement range provider for Python docs, when available #589

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

juliasilge
Copy link
Collaborator

Addresses posit-dev/positron#1646

You'll notice this is the first time these files have been edited since the formatting was added to this repo; I vote for just muddling through the unrelated formatting changes, if that's OK.

There are two changes needed to get quarto.runCurrent to work as we want it to in a Python .qmd:

  • Before this PR, that command resolved to the command for "run cell" so we need to not do that anymore, since this is a situation where we can identify a statement to run.
  • When I worked on Add executeSelection method to the extension host cell executor #436, I did not correctly use unadjustedRange() on the way back out of the statement range provider, because R doesn't have anything injected. Turns out that Python does:

inject: ["# type: ignore", "# flake8: noqa"],

@juliasilge
Copy link
Collaborator Author

You can get the .vsix from here to test this out, and what you'll see is that Cmd+Enter now steps through single lines in a Python .qmd, like it has for a while for R. There are some slight differences in behavior between R and Python when you are at the end of a chunk, which we could address with posit-dev/positron#3233.

Copy link
Contributor

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@juliasilge juliasilge merged commit 7d1582d into main Oct 28, 2024
1 check passed
@juliasilge juliasilge deleted the statement-range-provider-for-python branch October 28, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants