File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ type OnigScanner = vscodeOniguruma.OnigScanner & {
3030
3131const activeDocuments : {
3232 [ uriString : string ] : {
33+ document : vscode . TextDocument ;
3334 countDown : number ;
3435 timeout : NodeJS . Timeout | number | undefined ; // VSCode vs VSCode Web;
3536 } ;
@@ -69,10 +70,12 @@ export function debouncedDiagnostics(document: vscode.TextDocument) {
6970
7071 // https://github.com/microsoft/vscode/issues/11487
7172 const uriString = document . uri . toString ( ) ;
72- const activeDocument = activeDocuments [ uriString ] = activeDocuments [ uriString ] ?? {
73+ const activeDocument : typeof activeDocuments [ string ] = activeDocuments [ uriString ] = activeDocuments [ uriString ] ?? {
74+ document : document ,
7375 countDown : 0 ,
7476 timeout : undefined ,
7577 } ;
78+ activeDocument . document = document ;
7679 activeDocument . countDown ++ ; // waits longer the more edits there are
7780
7881 // Debounce recently repeated requests
@@ -85,7 +88,7 @@ export function debouncedDiagnostics(document: vscode.TextDocument) {
8588
8689 if ( activeDocument . countDown < 0 ) {
8790 clearInterval ( activeDocument . timeout ) ; // timeout.refresh() doesn't work in VSCode web
88- await Diagnostics ( document ) ;
91+ await Diagnostics ( activeDocument . document ) ;
8992 activeDocument . timeout = undefined ;
9093 }
9194
You can’t perform that action at this time.
0 commit comments