Skip to content

Conversation

@austin3dickey
Copy link
Contributor

Addresses #3731 and #10304. Switches the bootstrapped Pyright extension to Pyrefly.

Release Notes

New Features

  • We now bundle the Pyrefly extension, which gives a much richer Python editing experience, including better syntax highlighting

Bug Fixes

  • N/A

QA Notes

Try the LSP features, make sure the new default settings work, etc.

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

"python.analysis.typeCheckingMode": "off",
"ruff.importStrategy": "useBundled"
"ruff.importStrategy": "useBundled",
"python.pyrefly.displayTypeErrors": "force-on",
Copy link
Contributor Author

@austin3dickey austin3dickey Nov 19, 2025

Choose a reason for hiding this comment

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

The default behavior is to not show type-checking errors unless you have a pyrefly.toml or pyproject.toml with a [tool.pyrefly] section. This setting will make it always show type-checking errors. What do you think about this? I think they were off for pyright.

Copy link
Contributor

@isabelizimm isabelizimm Nov 19, 2025

Choose a reason for hiding this comment

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

I'd prefer the "not show type-checking errors unless you have a pyrefly.toml or pyproject.toml with a [tool.pyrefly] section" option, just to stay on the less-aggressive side of diagnostics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I am rethinking it and like this idea better.

"ruff.importStrategy": "useBundled",
"python.pyrefly.displayTypeErrors": "force-on",
"[python]": {
"editor.inlayHints.enabled": "offUnlessPressed"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This turns off inlay hints for Python files unless you hold down Ctrl+Option, which is kinda cool.

isabelizimm
isabelizimm previously approved these changes Nov 19, 2025
Copy link
Contributor

@isabelizimm isabelizimm left a comment

Choose a reason for hiding this comment

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

The code itself looks good! A few things I kicked the tired on, in .py scripts and notebooks:

  • general completion/syntax highlighting/clicking around
  • magic completion
  • x?? goto definition
  • hovering
  • autocomplete
  • finding references
  • renaming symbols

A few notes. I don't think they're blocking, but noting what I saw!

Should the highlighting be in the console as well? I see the old behavior there and in Quarto Python chunks.

FYI, I needed to clear state and rerun sh rebuild.sh to pick up these changes. I haven't tested a local build, but I'm guessing that pyrefly will download, but pyright will stay installed until a user uninstalls it or resets Positron's state. I think this is the right choice, but we may want to document that folks will have to do some finagling if there are conflicts.

@austin3dickey
Copy link
Contributor Author

I think the failing test is unrelated.

Should the highlighting be in the console as well? I see the old behavior there and in Quarto Python chunks.

I'll investigate! I don't want this PR to cause any regressions upon merge, but if there's something that's still missing that wasn't there before (e.g. better syntax highlighting in the console) I'll open tickets for future enhancements.

folks will have to do some finagling if there are conflicts

Good point, we'll check out what happens with tomorrow's daily build and document a recommendation in the release notes.

@austin3dickey
Copy link
Contributor Author

Investigating the missing features - I opened #10664 to do later and made sure there existed an issue for missing semantic tokens in Quarto docs: quarto-dev/quarto#420

I will look at the failing test again to make sure it's not related.

@ntluong95
Copy link

image

I just want to put a quick note here. There will be 2 LSP displayed in the Outline. If we bootstrap pyrefly, I guess we can turn off Jedi?

@austin3dickey
Copy link
Contributor Author

Yes @ntluong95 see #10305! (slated for later this week)

@austin3dickey austin3dickey merged commit d9880e6 into main Nov 19, 2025
39 of 40 checks passed
@austin3dickey austin3dickey deleted the aus/pyrefly branch November 19, 2025 22:16
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
@seeM
Copy link
Contributor

seeM commented Nov 20, 2025

Code changes look good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants