@@ -50,17 +50,15 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
5050 Diagnostics ( document ) ;
5151 }
5252
53- // context.subscriptions.push(
54- // vscode.workspace.onDidOpenTextDocument((document: vscode.TextDocument) => {
55- // // vscode.window.showInformationMessage(JSON.stringify("open"));
56- // if (!vscode.languages.match(DocumentSelector, document)) {
57- // return;
58- // }
59- // const uriString = document.uri.toString();
60- // activeDocuments[uriString] = { edits: null, timeout: null };
61- // Diagnostics(document, DiagnosticCollection);
62- // })
63- // );
53+ context . subscriptions . push (
54+ vscode . workspace . onDidOpenTextDocument ( ( document : vscode . TextDocument ) => {
55+ // vscode.window.showInformationMessage(JSON.stringify("open"));
56+ if ( ! vscode . languages . match ( DocumentSelector , document ) ) {
57+ return ;
58+ }
59+ Diagnostics ( document ) ;
60+ } )
61+ ) ;
6462
6563 // context.subscriptions.push(
6664 // vscode.workspace.onDidChangeTextDocument((edits: vscode.TextDocumentChangeEvent) => {
@@ -106,14 +104,12 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
106104 // })
107105 // );
108106
109- // context.subscriptions.push(
110- // vscode.workspace.onDidCloseTextDocument((document: vscode.TextDocument) => {
111- // // vscode.window.showInformationMessage(JSON.stringify("close"));
112- // const uriString = document.uri.toString();
113- // delete activeDocuments[uriString];
114- // DiagnosticCollection.delete(document.uri);
115- // })
116- // );
107+ context . subscriptions . push (
108+ vscode . workspace . onDidCloseTextDocument ( ( document : vscode . TextDocument ) => {
109+ // vscode.window.showInformationMessage(JSON.stringify("close"));
110+ DiagnosticCollection . delete ( document . uri ) ;
111+ } )
112+ ) ;
117113}
118114
119115function Diagnostics ( document : vscode . TextDocument ) {
0 commit comments