@@ -50,17 +50,15 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
50
50
Diagnostics ( document ) ;
51
51
}
52
52
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
+ ) ;
64
62
65
63
// context.subscriptions.push(
66
64
// vscode.workspace.onDidChangeTextDocument((edits: vscode.TextDocumentChangeEvent) => {
@@ -106,14 +104,12 @@ export function initDiagnostics(context: vscode.ExtensionContext) {
106
104
// })
107
105
// );
108
106
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
+ ) ;
117
113
}
118
114
119
115
function Diagnostics ( document : vscode . TextDocument ) {
0 commit comments