feat(python): add Pyrefly language server (#911)

Pyrefly (`pyrefly lsp`) joins basedpyright, Pyright and ty as a fallback Python language server. It is installable from Tools as a managed virtualenv tool and is listed among the interchangeable type checkers, before Ruff, so Ruff still runs after them.

Pyrefly only reports type errors in projects with a Pyrefly configuration (`pyrefly.toml` or `[tool.pyrefly]`); hover, completion and navigation work without one. A real-server test (ignored by default, needs `pyrefly` on PATH) covers startup, go-to-definition and diagnostics.

Co-authored-by: pcastro93 <2058578+pcastro93@users.noreply.github.com>
This commit is contained in:
Piettro
2026-11-03 14:42:45 +08:00
committed by GitHub
parent 038c23a2c8
commit b55c398fb5
9 changed files with 83 additions and 10 deletions
+8
View File
@@ -40,6 +40,14 @@ args = ["server"]
root-markers = ["ty.toml", "pyproject.toml", "setup.py", "setup.cfg", "requirements.txt", "Pipfile"]
install-hint = "uv tool install ty (or: pip install ty)"
[[language-servers]]
name = "pyrefly"
fallback = true
command = "pyrefly"
args = ["lsp"]
root-markers = ["pyrefly.toml", "pyproject.toml", "setup.py", "setup.cfg", "requirements.txt", "Pipfile"]
install-hint = "uv tool install pyrefly (or: pip install pyrefly)"
# Lint, format, organize imports and fix all next to the type checker, in
# projects configured for Ruff (formatting is Ruff's alone: basedpyright has none).
[[language-servers]]