Files
Young Seo Kim b7a6e5cdc0 call_hierarchy: Add gap between call hierarchy name and detail (#66144)
## Summary

Closes #64379

### 1: Space between signature and detail

Add `gap_1` in `render_match`.  

Before:
<img width="908" height="115" alt="Screenshot 2026-10-26 at 5 39 36 PM"
src="https://github.com/user-attachments/assets/f4d7d582-dd0c-459d-85c8-24744e463f10"
/>

after:
<img width="596" height="119" alt="Screenshot 2026-10-26 at 5 40 09 PM"
src="https://github.com/user-attachments/assets/9d863061-8246-40a0-b8f7-5660db91fdf6"
/>

### 2: Showing detail in tooltip + bug where tooltip would not show

needs_tooltip was computed from the width of the label text alone (e.g.
func helper), ignoring the separate detail (the package path). So even
when the rendered row (func helper path/to/go/repo/package) was wider
than the modal, the tooltip was never attached.

Fixes: 
- Width measurement: when the label doesn’t already contain the detail,
measure label + detail instead of just the label.
- Tooltip content: pass the detail into CallSignatureTooltip and render
it when the label doesn’t already contain it. Complete signature labels
(e.g. Rust’s fn helper(&self) -> i32) already include the detail, so it
isn’t appended twice.

Go example: 
<img width="1232" height="344" alt="image"
src="https://github.com/user-attachments/assets/a648054b-19eb-44d6-b465-315ccf14af44"
/>

Rust example:
<img width="733" height="142" alt="Screenshot 2026-10-26 at 11 59 51 PM"
src="https://github.com/user-attachments/assets/b854dd54-ce1f-4ef1-9849-bc6c5ae8413d"
/>

Tooltip now correctly shows on hover and includes detail while not
duplicating in the case the label already has it.


## Testing

all tests in `call_hierarchy` pass and I've added two tests:
- Added a regression test that the tooltip appends the separate detail
for name-only labels (e.g. Go package paths).
- Added a regression test that a complete signature label (e.g. Rust)
does not get its detail appended twice.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
 
Release Notes:

- Improved call hierarchy item details: added spacing between the name
and detail, and fixed the hover tooltip to show the full detail
(including package paths) when the row is truncated

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-03 21:30:48 +00:00
..