test: document enum semantic-token classification bugs (#5050) Summary: Semantic tokens classify attributes from their inferred value types instead of their definitions. Snapshots capture the current misclassification, with comments identifying the correct enumMember or property token for each affected case. These LSP tests use ordinary Rust `#[test]` functions, so explicit `BUG` comments document the incorrect behavior and the correct result. These are passing tests of known bugs, following [the repository test guidance](https://github.com/facebook/pyrefly/blob/main/AGENTS.md#the-bug-marker-in-tests). The complete implementation and regression tests remain in [PR https://github.com/facebook/pyrefly/issues/4794](https://github.com/facebook/pyrefly/pull/4794). Related issue: https://github.com/facebook/pyrefly/issues/4751. ## Validation Based on upstream `main` at `ef6de648bce0dc6dcca0a21a9fbb7490f23ecce8`. - `cargo test -p pyrefly --lib -- enum_member_definition_test narrowed_enum_instance_attribute_test` — passed. - `python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema --no-extension` — passed. Pull Request resolved: https://github.com/facebook/pyrefly/pull/5050 Reviewed By: rchen152 Differential Revision: D122390462 fbshipit-source-id: 79027859a79c700aca570d74df86de37bf3e66de
Pyrefly is a type checker and language server for Python, which provides lightning-fast type checking along with IDE features such as code navigation, semantic highlighting, and code completion. It is available as a command-line tool and an extension for popular IDEs and editors such as VSCode, Neovim, Zed, and more.
See the Pyrefly website for full documentation and how to add Pyrefly to your editor of choice.
Pyrefly's current development status is stable.
pyrefly init, silence existing errors with pyrefly suppress, and generate type annotations with pyrefly infer. Start with one file and expand at your own pace.pip install pyreflyPyrefly releases new minor versions (1.x.0) monthly and patch versions in between as-needed for critical fixes. Pyrefly does not follow strict semantic versioning: minor versions contain more significant changes than patch versions, but any version may introduce new type errors and other breaking changes. The pyrefly suppress command can be used to easily silence errors when upgrading to a new version.
If you have questions or would like to report a bug, please create an issue.
See our contributing guide and architecture overview for information on how to contribute to Pyrefly.
Join our Discord to chat about Pyrefly and types. This is also where we hold biweekly office hours.