Skip to content

Commit 15b634e

Browse files
committed
Clear diagnostic collection when document is changed but has no content
Closes #16
1 parent 9a3c089 commit 15b634e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export const activate = (context: vscode.ExtensionContext) => {
1414

1515
context.subscriptions.push(
1616
vscode.workspace.onDidChangeTextDocument(event => {
17+
if (event.document.getText() === "") {
18+
collection.delete(event.document.uri);
19+
return;
20+
};
1721
updateDiagnostics(event.document, collection);
1822
})
1923
);

0 commit comments

Comments
 (0)