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 |
||
|---|---|---|
| .. | ||
| annotation.md | ||
| builtins.md | ||
| callable_instance.md | ||
| callables_as_descriptors.md | ||
| constructor.md | ||
| dunder.md | ||
| dunder_import.md | ||
| function.md | ||
| getattr_static.md | ||
| invalid_syntax.md | ||
| methods.md | ||
| never.md | ||
| open.md | ||
| overloads.md | ||
| replace.md | ||
| str_startswith.md | ||
| subclass_of.md | ||
| union.md | ||