zed/crates/search
Kirill Bulatov 8d3c251cc2
Rework inlay hover model (#2969)
Fixes
```
thread 'main' panicked at 'byte index 2 is not a char boundary; it is inside '…' (bytes 0..3) of `…)`'
```
panics like
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1694535396473329

by reworking the inlay hover model:
* avoid storing "hardcoded" coordinates of hovered inlay labels (such as
`InlayOffset`), instead, remember `inlay_id` and apply required
highlights there when hint with the same id is handled
* add randomized tests on inlay highlights
* sped up inlay hint cache lookup by inlay_id

As a downside, background highlights are no long appearing on inlay
hints, but Zed does not receive any tooltips for inlays anyway (r-a does
not send them for some reason, other LSP seem to have no such feature?),
so it does not matter now.
Nontheless, if the logic for displaying hint pop-ups is present and
works for harcoded tooltips in r-a, only background highlight is missing
now.

Release Notes:

- Fixed inlay hint highlights causing panic for certain cases with
"large" characters
2023-09-15 10:40:02 +03:00
..
src Rework inlay hover model (#2969) 2023-09-15 10:40:02 +03:00
Cargo.toml