Handle workspace file-operation notifications

The server advertises didCreate/didRename/didDelete file operations
with file-scheme filters. A bounded core converts notifications into
canonical filesystem changes (rename as old-gone/new-present, non-file
URIs ignored, invalid URIs rejected) with registered tests, and
EditorDiagnostics invalidates every dependent index context for
changed or removed paths before re-queueing open documents. A real
stdio session observed the index become incomplete after a deleted
header, and a malformed notification left the server answering.
This commit is contained in:
faumaray committed 2026-12-05 16:03:06 +03:00
1 parent 130cb57a7f
commit 158125ace5
12 files changed
+248 -12

No files matched your search

+12
View File
@@ -696,6 +696,18 @@ void EditorDiagnostics::begin_update() {
s.module_work.cancel(key);
}
}
void EditorDiagnostics::files_changed(std::span<const features::file_operations::Change> changes) {
auto &s = *state_;
std::lock_guard lock{s.mutex};
for (const auto &change : changes) {
if (change.gone)
s.symbols.clear_overlay(change.path);
// The new content is unknown, so the path is treated as changed: every
// context that consumed it is marked incomplete, never silently kept.
s.symbols.invalidate(change.path, std::nullopt);
}
}
void EditorDiagnostics::finish_update(bool workspace_changed) {
auto &s = *state_;
auto overlays = s.documents.list_overlays();