{"slug": "pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code", "title": "Pylance and Pyrefly: bring your preferred type checker to Visual Studio Code", "summary": "Microsoft announced the Type Server Protocol (TSP), an open standard extending the Language Server Protocol that lets any type checker plug into Pylance as an interchangeable backend, and a partnership with Meta to bring Meta's Pyrefly checker to Pylance in Visual Studio Code. Pyright remains the default checker for most users, but developers can now switch checkers from the VS Code status bar while keeping Pylance's completions, Quick Info, environment management and GitHub Copilot integration. Meta says Pyrefly checks code at 1.8 million lines per second, and the company has brought NumPy to nearly 90% type completeness and completed pandas' public API type coverage.", "body_md": "At Microsoft, our focus is on providing the best possible experience for Python developers – both for everyday coding and for the agentic workflows that are increasingly central to how developers build software.\nA great type checking experience is a core part of that, not only for surfacing accurate and actionable diagnostics and providing a strong foundation for Intellisense, but as the bedrock of static semantic intelligence for software agents.\nToday we’re announcing the [**Type Server Protocol (TSP)**](https://github.com/microsoft/pylance-release/blob/main/docs/tsp/type-server-protocol.md) and our partnership with Meta to bring [Pyrefly](https://Pyrefly.org/) support to [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance).\n\n## Introducing the Type Server Protocol\n\nTSP is an open standard that extends [LSP – the Language Server Protocol](https://microsoft.github.io/language-server-protocol/) that underpins editor integrations across the industry – designed to allow any editor or tool to integrate type checkers as first-class backends.\n\nUntil now, Pylance and [Pyright](https://github.com/microsoft/pyright) were tightly coupled. TSP creates a clean separation between the two: Pylance becomes the [VS Code](https://code.visualstudio.com/) IDE intelligence layer for Python, and the type checker becomes an interchangeable static analysis component underneath it.\nPyright remains the default and continues to power the experience for the vast majority of users.\nBut for developers who have a strong preference – or whose codebase is better served by a different checker – switching is now a straightforward operation, right from the VS Code status bar.\n\nWhat stays constant regardless of which checker you use is Pylance’s completions, Quick Info, environment management, and critically its deep integration with GitHub Copilot. Those experiences are built on Pylance, not on any individual type checker. TSP means you can bring the checker you want without giving up any of those features that you know and love.\n\n## Partnering with Meta to bring Pyrefly to Pylance\n\nWe are excited to announce that we have partnered with Meta to design and implement the TSP protocol and make sure that Pyrefly fully supports it.\nThis collaboration is built on a shared belief that the Python ecosystem is better served by interoperability than by fragmentation.\nMeta brings deep expertise in fast static type analysis and a particular strength in AI/ML library support.\nMicrosoft brings the VS Code IDE integration layer and the [GitHub Copilot](https://github.com/features/copilot) experience.\nTSP is the protocol that makes them work together.\n\nMeta has been at the forefront of Python typing longer than almost anyone.\nSince 2017, they have been solving type checking at scale on some of the world’s largest Python codebases, including [Instagram](https://www.instagram.com/).\nThat experience shaped every design decision in Pyrefly, which checks code at 1.8 million lines per second and was built from the ground up to deliver a consistent experience in both CI and the IDE.\nMeta has also invested heavily in the broader ecosystem, bringing [NumPy](https://numpy.org/) to nearly 90% type completeness, completing [pandas](https://pandas.pydata.org/)‘ public API type coverage, and publishing the most comprehensive public performance [benchmarks for Python type checkers](https://pyrefly.org/blog/speed-and-memory-comparison/#the-benchmark).\n\nWe are proud to partner with Meta on bringing Pyrefly to Pylance and we look forward to the ecosystem growing around this open standard, and to bringing even more choice to Python developers in the future.\n\n## Why Pylance + TSP + Pyrefly instead of Pyrefly standalone?\n\nThis is the right question to ask.\nPyrefly already has a highly performant [VS Code extension](https://marketplace.visualstudio.com/items?itemName=meta.pyrefly) and is an excellent choice for type checking in continuous integration (CI).\nWhy use it through Pylance instead of directly?\n\nPylance provides tight integrations with the GitHub Copilot experience that a standalone type checker extension can’t replicate – context provision for AI completions, intelligent code understanding that feeds into GitHub Copilot Chat, MCP tools for Python codebases, and the full suite of Python developer tooling that Pylance has built over years in production. In decoupling Pyright from Pylance we now have a clear separation of concerns where pylance can provide an intelligence layer for Python developers and delegate the heavy lifting of type checking. By using Pyrefly with Pylance via TSP, you get Pyrefly’s type analysis powering the engine, with Pylance’s AI-aware intelligence layer on top. You don’t have to choose.\n\n## How to try it\n\nTSP support with Pyrefly requires a Pylance version of 2026.4.1 or newer. Here’s how the experience works.\n\n### Automatic detection\n\nWhen you open a workspace, Pylance checks your Python environments for a Pyrefly installation.\nIf it finds one – whether installed in your virtual environment or signaled by a `pyrefly.toml` or `tool.pyrefly` config in your `pyproject.toml` – you’ll see a notification:\n\nPyrefly was found in your Python environment. Would you like to use it as your source of diagnostics in VS Code?\n\nClick **Switch to Pyrefly** and Pylance will activate Pyrefly as your diagnostics source immediately, registering the path to the Pyrefly executable automatically.\nNo manual configuration needed.\nand the choice to “Switch to Pyrefly” can always be reverted or reenabled via Settings.\n\n### Manual setup via settings\n\nYou can also switch at any time through the VS Code Settings UI.\nUnder [**Python › Analysis: Diagnostics Source**](//settings/python.analysis.diagnosticsSource), you’ll find a dropdown with three options:\n\n- Pylance – default, uses Pylance’s built-in analysis\n- Pylance + Pyright – explicitly routes diagnostics through Pyright\n- Pylance + Pyrefly – uses Pyrefly as the diagnostics engine\n\nWhen Pylance + Pyrefly is selected, Pylance will search for a Pyrefly installation in your virtual environments or download it automatically.\n\nA companion [**Python › Analysis: Pyrefly Version**](//settings/python.analysis.pyreflyVersion) setting lets you pin a specific version, point to a local executable, or leave it empty to always use the latest.\nThe minimum supported version is 0.60.0.\n\n### Status bar\n\nOnce active, the status bar shows **Diagnostics Source: Pylance + Pyrefly** alongside your interpreter and environment.\n\nClicking it opens the [**Python › Analysis: Diagnostics Source**](//settings/python.analysis.diagnosticsSource) setting.\n\n## What do you think?\n\nTry the new Pylance + Pyrefly experience today in VS Code and let us know your thoughts. Share any feedback by [opening an issue or voting on an existing one](https://github.com/microsoft/pylance-release/issues/). You can also leave a comment below or reach us on [X](https://x.com/pythonvscode).\n\nThe Pyrefly team have their [own blog post](https://pyrefly.org/blog/pyrefly-pylance) on TSP and the work we have done together.", "url": "https://wpnews.pro/news/pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code", "canonical_source": "https://devblogs.microsoft.com/python/announcing-tsp/", "published_at": "2026-10-23 20:44:31+00:00", "updated_at": "2026-10-23 21:12:50.880565+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Microsoft", "Meta", "Pylance", "Pyrefly", "Pyright", "Type Server Protocol", "Visual Studio Code", "GitHub Copilot"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code", "markdown": "https://wpnews.pro/news/pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code.md", "text": "https://wpnews.pro/news/pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code.txt", "jsonld": "https://wpnews.pro/news/pylance-and-pyrefly-bring-your-preferred-type-checker-to-visual-studio-code.jsonld"}}