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 & {
30
30
31
31
const activeDocuments : {
32
32
[ uriString : string ] : {
33
+ document : vscode . TextDocument ;
33
34
countDown : number ;
34
35
timeout : NodeJS . Timeout | number | undefined ; // VSCode vs VSCode Web;
35
36
} ;
@@ -69,10 +70,12 @@ export function debouncedDiagnostics(document: vscode.TextDocument) {
69
70
70
71
// https://github.com/microsoft/vscode/issues/11487
71
72
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 ,
73
75
countDown : 0 ,
74
76
timeout : undefined ,
75
77
} ;
78
+ activeDocument . document = document ;
76
79
activeDocument . countDown ++ ; // waits longer the more edits there are
77
80
78
81
// Debounce recently repeated requests
@@ -85,7 +88,7 @@ export function debouncedDiagnostics(document: vscode.TextDocument) {
85
88
86
89
if ( activeDocument . countDown < 0 ) {
87
90
clearInterval ( activeDocument . timeout ) ; // timeout.refresh() doesn't work in VSCode web
88
- await Diagnostics ( document ) ;
91
+ await Diagnostics ( activeDocument . document ) ;
89
92
activeDocument . timeout = undefined ;
90
93
}
91
94
You can’t perform that action at this time.
0 commit comments