Pylance 2026.4.1 Adds Support for Meta Pyrefly via Type Server Protocol
The latest Pylance update introduces the Type Server Protocol, allowing developers to integrate Meta's high-performance Pyrefly type checker while retaining core IDE and AI features.
Pylance 2026.4.1 adds support for Meta's Pyrefly type checker via the new Type Server Protocol (TSP). Released on October 21 alongside Pylance, TSP extends the Language Server Protocol (LSP) to allow type checkers to run as interchangeable components beneath editor language features.
Pyright remains the default type checker for most users. When Pylance 2026.4.1 or newer opens a workspace, it detects Pyrefly as an installed package or through a pyrefly.toml or tool.pyrefly entry in pyproject.toml, then prompts you to switch.
You can also configure the diagnostics source manually under Python › Analysis: Diagnostics Source by selecting Pylance + Pyrefly. This option prompts Pylance to search virtual environments or download Pyrefly, which requires version 0.60.0 or newer. You can pin versions or point to a local executable using a separate Pyrefly Version setting, and you can revert the change in settings at any time.
Completions, Quick Info, environment management, and GitHub Copilot integrations remain unchanged regardless of which checker runs. Running Pyrefly through Pylance retains Copilot features like context for AI completions, input to Copilot Chat, and MCP tools that standalone checker extensions cannot replicate.
Meta has used Pyrefly on codebases like Instagram since 2017, achieving a check rate of 1.8 million lines of code per second.
