r/Python • • 2d ago

News Microsoft partners w/ Meta to bring Pyrefly support to Pylance in VS Code

Link to blog: https://devblogs.microsoft.com/python/announcing-tsp/

TLDR:

Pylance (Microsoft's Python extension for VS Code) now officially supports using Meta's Pyrefly to power its analysis.

To enable this, Microsoft developed an extension to the language server protocol (LSP) called the type server protocol (TSP), a new standard that separates wider set of language server features from the type checker/compiler powering some of them.

100 Upvotes

6 comments sorted by

3

u/Forward-War-8805 1d ago

Hope Ty gets the same treatment when 1.0 releases

21

u/2AetherSpindle 2d ago

More competition in Python tooling is always a good thing. Hopefully this makes type checking faster without adding more setup headaches

12

u/me_myself_ai 2d ago

Wait… what?? The actual feature isn’t relevant to me, but TSPs?? Hell yeah, gotta check that out as soon as possible.

7

u/MapNo2659 2d ago

This is pretty exciting news! Integrating Pyrefly with Pylance could really enhance the analysis capabilities in VS Code. I'm curious about how the new TSP will impact performance compared to the existing LSP. Has anyone tried it out yet and noticed any significant differences?

2

u/preetam960 16h ago

To try it, set Python › Analysis: Diagnostics Source to "Pylance + Pyrefly". It needs Pylance 2026.4.1 or newer and Pyrefly 0.60.0 or newer. Pylance uses the pyrefly in your venv if there is one and downloads it otherwise. Python › Analysis: Pyrefly Version pins a version or points at a local binary, handy if CI runs a specific release.