fix: retain semantic colors across editable diff updates

This commit is contained in:
Valdemar Lorenzen
2026-10-15 15:48:34 +02:00
parent a3be494d57
commit 1df9e66cd5
7 changed files with 322 additions and 48 deletions
+5 -2
View File
@@ -238,8 +238,11 @@ impl Lsp {
if !Arc::ptr_eq(&cached.snapshot, &snapshot) {
cached.snapshot = Arc::clone(&snapshot);
cached.diagnostics.clear();
cached.semantic_tokens = None;
self.changed_semantics.insert(snapshot.id);
if cached.semantic_tokens.take().is_some() {
// Discard queued old coordinates, not explicit clears such as retirement.
// The editor keeps remapped colors until a server reply replaces them.
self.changed_semantics.remove(&snapshot.id);
}
self.changed_diagnostics.insert(snapshot.id);
}
}