Skip to content

Commit 219e015

Browse files
committed
Add event listener to remove diagnostics on document close
1 parent 4f50578 commit 219e015

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/extension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export const activate = (context: vscode.ExtensionContext) => {
2121
updateDiagnostics(event.document, collection);
2222
})
2323
);
24+
25+
context.subscriptions.push(
26+
vscode.workspace.onDidCloseTextDocument(document => {
27+
collection.delete(document.uri);
28+
})
29+
);
2430
};
2531

2632
const updateDiagnostics = (

0 commit comments

Comments
 (0)