Rework inlay hint cache tests (#23156)

Closes https://github.com/zed-industries/zed/issues/7928

* uncomments and fixes all inlay hint cache tests
* fixes a bug, where invalidated range did not store the new queried
ranges in the cache: this resulted in extra requests in editor that do
not fit into the screen
* comments a peculiarity with the `RefreshInlayHints` event: all editors
react to that when a new language server is inserted, even though
certain editors are not related to the new language server
* fixes handling of inlay hints for the same position: now the same
order is kept, as in the language server's response
(https://github.com/zed-industries/zed/issues/7928)
* queries for hints when on excerpt(s) expansion

Release Notes:

- Fixed inlay hints handling for the same position
This commit is contained in:
Kirill Bulatov 2025-01-15 20:13:15 +02:00 committed by GitHub
parent 135e58f1e2
commit 22f5fd53ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 816 additions and 846 deletions

View file

@ -12441,6 +12441,7 @@ impl Editor {
cx.emit(EditorEvent::ExcerptsEdited { ids: ids.clone() })
}
multi_buffer::Event::ExcerptsExpanded { ids } => {
self.refresh_inlay_hints(InlayHintRefreshReason::NewLinesShown, cx);
cx.emit(EditorEvent::ExcerptsExpanded { ids: ids.clone() })
}
multi_buffer::Event::Reparsed(buffer_id) => {