Releases: facebook/pyrefly
v0.21.0
Pyrefly 0.21.0
Status : ALPHA
Release date: 23 June 2025
Pyrefly 0.21.0 delivers 176 commits from 20 contributors. We now support a number of highly requested features such as Semantic Highlighting, Signature Help, Document Highlights and Auto Import Completions! Follow along for more LSP functionality #344 ahead of our V1 release.
✨ New & Improved
| Area | What’s new |
|---|---|
| IDE / LSP (Issue #344) | • Richer semantic highlighting – method calls, property accesses, and the expressions nested in them now get distinct token types, so editors like VS Code underline exactly what you expect (#344). • Added the defaultLibrary semantic-token modifier for symbols originating from builtins, typing, or typing_extensions; makes built-ins stand out in both dark/light themes. |
| Diagnostics | • Detailed override errors – incompatibilities between a subclass attribute and its parent now explain why they don’t match (“read-write vs read-only”, “int vs str”, etc.) on a second indented line. |
| Type-system smarts | • InitVar fields in @dataclass definitions are no longer treated as instance attributes, eliminating false “missing attribute” errors (PR [#437]). • Full support for Variance Inference in Generic Classes with PEP 695 |
| Performance | • A pathological Callable | … union test that once blew up exponentially now checks in linear time. |
🐛 Other bug fixes
- Multiple edge-case panics removed, including starred targets inside augmented assignments and cyclic class-type substitutions.
- Hover & go-to-definition in LSP no longer crash when traversing keyword-only or pattern-match bindings.
- Cargo / Rust nightly warnings cleaned up; WASM build green again.
🚨 Potentially breaking
- The new, more explicit override-mismatch diagnostics may fail code that relied on silent attribute-type changes.
- Editors that hard-code semantic-token kinds should be updated to recognise the new
defaultLibrarymodifier.
📦 Upgrade
pip install --upgrade pyrefly==0.21.0🖊️ Contributors this release
@yangdanny97 @Adist319 @grievejia @connernilsen @migeed-z @ndmitchell @xl4624 @stroxler @rchen152 @TheRustyPickle @dluo @kinto0 @pt2302 @SamChou19815 @ducdetronquito @xaskii @Alex-Aron @hugovk @grantlouisherman @rubmary
v0.20.0
Pyrefly 0.20.0
Status : ALPHA
Release date: 16 June 2025
Pyrefly 0.20.0 represents 165 commits from 21 contributors and focuses on stability, friendlier diagnostics, and CLI quality-of-life.
Special thanks to @TheRustyPickle, @ducdetronquito, @pt2302, @akmalsoliev and every reviewer, tester and bug-reporter who helped make this release!
✨ New & Improved
| Area | What’s new |
|---|---|
| Diagnostics & error messages | •We now print a snippet of source code in each message, highlighting the error location. You can control error message verbosity with the new --output-format=min-text and --output-format=full-text options.•Add tests to keep Error Kinds in sync with documentation, in addition to reclassifying Error Kinds previously reported as Unknown (#477).• Import errors are now shown on separate lines with source hints, thanks to the new BindingsBuilder::error_multiline helper (commit 2bba00f).• TypeVar reveal output is shorter and clearer – no more variance=PInvariant noise (#225). |
| Editor support | •Basic support for Semantic Highlighting, a highly requested feature (#218). More improvements to come in future releases. |
| Configuration / CLI | • New flags --replace-imports-with-any and --ignore-missing-source let you suppress noisy import errors without editing config files (#480 → closes #460 & #462). |
| Type-system smarts | • Conflicting Required/NotRequired qualifiers in a single TypedDict field now surface an explicit error (#447→ fixes #414). |
| Project workflow | • pyrefly init edits an existing pyproject.toml in-place instead of appending duplicate [tool.pyrefly] sections (#336). |
🐛 Other notable bug fixes
- Panics fixed:
- Hover & go-to-definition no longer crash the LSP on keyword-only or pattern-match bindings.
- Build is quiet again on nightly Rust; cleaned up stray clippy warnings.
🚨 Potentially breaking
- Flag & message renames – some diagnostics switched from snake-case to kebab-case and new CLI flags were introduced (#480). Update any scripts that parse
pyrefly check --helpor grep error kinds. - The
TypedDictqualifier rule (#447) may surface new errors where bothRequiredandNotRequiredwere previously accepted.
📦 Upgrade
pip install --upgrade pyrefly==0.20.0🖊️ Contributors in this release
@rchen152, @grievejia, @stroxler, @ajaymiranda, @connernilsen, @pt2302, @kinto0, @yangdanny97, @ndmitchell, @migeed-z, @hugovk, @dtolnay, @Alex-Aron, @Adist319, @zachmullen, @grantlouisherman, @rubmary, @dluo, @maggiemoss, @kinto0, @SamChou19815
v0.19.0
Pyrefly 0.19.0
Status : ALPHA
Release date: 9 June 2025
Pyrefly 0.19.0 packs a week’s worth of fixes and quality‑of‑life improvements into 128 commits from 19 contributors, touching 153 files.
Thank you @ajaymiranda @Adist319 @Alex-Aron @zachmullen for your contributions!
✨ New & Improved
| Area | What’s new |
|---|---|
| Editor support | • Neovim integration — first‑class LSP support plus a helper command to install/update the server (#227). • Neovim now respects pyrefly.toml and remote config overrides (#442). |
| Configuration UX | • Eliminates misleading “Extra keys” parse errors in pyrefly.toml (#441). • Added validation that a TypedDict field cannot be both Required and NotRequired (#414). |
| Diagnostics | • reveal_type messages are now INFO‑level instead of errors, so they no longer fail CI runs when you’re just inspecting types (#304).• isinstance() checks involving Union[...] are now inferred correctly (#426). |
| Type‑system smarts | • Better handling of Self generics in chained method calls (#152).• Fixed constrained TypeVar attribute access (#318).• Fixed failure when calling methods on a plain TypeVar (#150). |
| Stub & third‑party typing | • Works with inline stub files that live beside their implementation (#419). • Correctly recognises pandas-stubs generic aliases such as Index without type arguments (#427). |
🐛 Other notable bug fixes
- Duplicate “NoReturn / Never” return‑annotation error reduced to a single authoritative report (#425).
- Numerous minor LSP crashes and hover glitches fixed.
- Documentation on website and CLI cleanup
🚨 Potentially breaking
- The new
TypedDictqualifier rule (#414) will surface errors in code that previously passed silently. - If you relied on
reveal_typeraising an error exit status, update scripts to look for an info‑level diagnostic instead (#304).
📦 Upgrade
pip install --upgrade pyrefly==0.19.0🖊️ Contributors in this release
@Adist319, @Alex-Aron, @connernilsen, @yangdanny97, @dluo , @dtolnay, @hugovk, @grantlouisherman, @grievejia, @kinto0, @maggiemoss, @ndmitchell, @rchen152, @rubmary, @SamChou19815, @stroxler, @migeed-z