mirror of https://github.com/astral-sh/ruff
This PR generalizes the signature_help system's SignatureWriter which could get the subspans of function parameters. We now have TypeDetailsWriter which is threaded between type's display implementations via a new `fmt_detailed` method that many of the Display types now have. With this information we can properly add goto-type targets to our inlay hints. This also lays groundwork for any future "I want to render a type but get spans" work. Also a ton of lifetimes are introduced to avoid things getting conflated with `'db`. This PR is broken up into a series of commits: * Generalizing `SignatureWriter` to `TypeDetailsWriter`, but not using it anywhere else. This commit was confirmed to be a non-functional change (no test results changed) * Introducing `fmt_detailed` everywhere to thread through `TypeDetailsWriter` and annotate various spans as "being" a given Type -- this is also where I had to reckon with a ton of erroneous `&'db self`. This commit was also confirmed to be a non-functional change. * Finally, actually using the results for goto-type on inlay hints! * Regenerating snapshots, fixups, etc. |
||
|---|---|---|
| .. | ||
| src | ||
| tests/e2e | ||
| Cargo.toml | ||