Use proper, limited excerpt ranges and manage inlay cache properly

This commit is contained in:
Kirill Bulatov 2023-06-15 21:18:09 +03:00
parent 2b989a9f12
commit 76d35b7122
4 changed files with 159 additions and 55 deletions

View file

@ -249,6 +249,10 @@ impl DisplayMap {
to_insert: Vec<(InlayId, InlayProperties<T>)>,
cx: &mut ModelContext<Self>,
) {
if to_remove.is_empty() && to_insert.is_empty() {
return;
}
let buffer_snapshot = self.buffer.read(cx).snapshot(cx);
let edits = self.buffer_subscription.consume().into_inner();
let (snapshot, edits) = self.inlay_map.sync(buffer_snapshot, edits);