Skip to content

Commit 0f13d77

Browse files
Copilotdbaeumer
andcommitted
Fix: always pull diagnostics on didOpen even if document is known via tab
When a document is restored from a tab (e.g., hot exit), the tab open event fires before the didOpen notification. The tab handler triggers a diagnostic pull with potentially stale content. Previously, when didOpen fired, the knows() check would skip re-pulling diagnostics. Now the didOpen handler always triggers a diagnostic pull. The existing pullAsync logic handles deduplication - if a request is already active, it cancels it and reschedules with the current document content. Fixes #1558 Co-authored-by: dbaeumer <1931590+dbaeumer@users.noreply.github.com>
1 parent eef3bb2 commit 0f13d77

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

client/src/common/diagnostic.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,6 @@ class DiagnosticFeatureProviderImpl implements DiagnosticProviderShape {
864864
const openFeature = client.getFeature(DidOpenTextDocumentNotification.method);
865865
disposables.push(openFeature.onNotificationSent((event) => {
866866
const textDocument = event.textDocument;
867-
// We already know about this document. This can happen via a tab open.
868-
if (this.diagnosticRequestor.knows(PullState.document, textDocument)) {
869-
return;
870-
}
871867
if (matches(textDocument)) {
872868
this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });
873869
}

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)