mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-22 11:19:32 +00:00
Make sure we update pending files properly
The previous logic failed to add anything to the pending files list For #77665
This commit is contained in:
@@ -42,7 +42,7 @@ function mode2ScriptKind(mode: string): 'TS' | 'TSX' | 'JS' | 'JSX' | undefined
|
||||
class BufferSynchronizer {
|
||||
|
||||
private _pending: Proto.UpdateOpenRequestArgs = {};
|
||||
private _pendingFiles = new Set<string>();
|
||||
private readonly _pendingFiles = new Set<string>();
|
||||
|
||||
constructor(
|
||||
private readonly client: ITypeScriptServiceClient
|
||||
@@ -132,11 +132,14 @@ class BufferSynchronizer {
|
||||
}
|
||||
|
||||
private updatePending(filepath: string, f: (pending: Proto.UpdateOpenRequestArgs) => void): void {
|
||||
if (this.supportsBatching && this._pendingFiles.has(filepath)) {
|
||||
this.flush();
|
||||
this._pendingFiles.clear();
|
||||
f(this._pending);
|
||||
if (this.supportsBatching) {
|
||||
if (this._pendingFiles.has(filepath)) {
|
||||
// we saw this file before, make sure we flush before working with it again
|
||||
this.flush();
|
||||
this._pendingFiles.clear();
|
||||
}
|
||||
this._pendingFiles.add(filepath);
|
||||
f(this._pending);
|
||||
} else {
|
||||
f(this._pending);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user