mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
When two type hints sit one source character apart (e.g. a `::T` hint just before a closing token and another `::U` hint right after it), `clip_point(_, Bias::Right)` skips through the lone source character so both hints fall inside the buffer-position window used to find a hovered hint. The previous `max_by_key(|hint| hint.id)` heuristic then picked an arbitrary one, which often was not the inlay actually under the mouse. Filter the candidate hints by the actual mouse `hovered_offset` so the hint whose rendered text is under the cursor is the one resolved for hover and link navigation. Additionally, the popover previously used the inlay's buffer anchor directly, which in display space always lands at the inlay's leading edge — so for long or multi-part inlays the popover would appear at the start of the inlay regardless of which character was hovered. Resolve the actual display position by adding the in-inlay byte offset onto the inlay's start. |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||