Skip to content

Commit

Permalink
Fix Diagnostics not loading/unloading
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Sep 8, 2024
1 parent 6929824 commit 49ebf22
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/DiagnosticCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,15 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
Diagnostics(document);
}

// context.subscriptions.push(
// vscode.workspace.onDidOpenTextDocument((document: vscode.TextDocument) => {
// // vscode.window.showInformationMessage(JSON.stringify("open"));
// if (!vscode.languages.match(DocumentSelector, document)) {
// return;
// }
// const uriString = document.uri.toString();
// activeDocuments[uriString] = { edits: null, timeout: null };
// Diagnostics(document, DiagnosticCollection);
// })
// );
context.subscriptions.push(
vscode.workspace.onDidOpenTextDocument((document: vscode.TextDocument) => {
// vscode.window.showInformationMessage(JSON.stringify("open"));
if (!vscode.languages.match(DocumentSelector, document)) {
return;
}
Diagnostics(document);
})
);

// context.subscriptions.push(
// vscode.workspace.onDidChangeTextDocument((edits: vscode.TextDocumentChangeEvent) => {
Expand Down Expand Up @@ -106,14 +104,12 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
// })
// );

// context.subscriptions.push(
// vscode.workspace.onDidCloseTextDocument((document: vscode.TextDocument) => {
// // vscode.window.showInformationMessage(JSON.stringify("close"));
// const uriString = document.uri.toString();
// delete activeDocuments[uriString];
// DiagnosticCollection.delete(document.uri);
// })
// );
context.subscriptions.push(
vscode.workspace.onDidCloseTextDocument((document: vscode.TextDocument) => {
// vscode.window.showInformationMessage(JSON.stringify("close"));
DiagnosticCollection.delete(document.uri);
})
);
}

function Diagnostics(document: vscode.TextDocument) {
Expand Down

0 comments on commit 49ebf22

Please sign in to comment.