Implement InlayHint sync method and fix the bugs

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Kirill Bulatov 2023-06-08 17:39:04 +03:00
parent 5ad85b44d6
commit 5fadbf77d4
3 changed files with 43 additions and 25 deletions

View file

@ -2672,6 +2672,8 @@ impl Editor {
let buffer_id = excerpt_buffer_snapshot.remote_id();
let should_update_hints = editor
.update(&mut cx, |editor, _| {
// TODO kb wrong: need to query hints per buffer, not per excerpt
// need to store the previous state and calculate the diff between them, and calculate anchors here too.
editor.inlay_hint_versions.insert(
InlayHintLocation {
buffer_id,