mirror of https://github.com/astral-sh/ruff
## Summary Working on py-fuzzer recently (AKA, a Python project!) reminded me how cool our "inlay hint goto-definition feature" is. So this PR adds a bunch more of that! I also made a couple of other minor changes to type display. For example, in the playground, this snippet: ```py def f(): ... reveal_type(f.__get__) ``` currently leads to this diagnostic: ``` Revealed type: `<method-wrapper `__get__` of `f`>` (revealed-type) [Ln 2, Col 13] ``` But the fact that we have backticks both around the type display and inside the type display isn't _great_ there. This PR changes it to ``` Revealed type: `<method-wrapper '__get__' of function 'f'>` (revealed-type) [Ln 2, Col 13] ``` which avoids the nested-backticks issue in diagnostics, and is more similar to our display for various other `Type` variants such as class-literal types (`<class 'Foo'>`, etc., not ``<class `Foo`>``). ## Test Plan inlay snapshots added; mdtests updated |
||
|---|---|---|
| .. | ||
| corpus | ||
| mdtest | ||
| primer | ||
| README.md | ||
README.md
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/ty_test/README.md for documentation of this test format.