Make sure buffer sync reset clears pending diagnostics
This commit is contained in:
parent
7218d47251
commit
21fd94b70c
|
@ -394,7 +394,10 @@ export default class BufferSyncSupport extends Disposable {
|
|||
return vscode.Uri.file(filePath);
|
||||
}
|
||||
|
||||
public reOpenDocuments(): void {
|
||||
public reset(): void {
|
||||
this.pendingGetErr?.cancel();
|
||||
this.pendingDiagnostics.clear();
|
||||
|
||||
for (const buffer of this.syncedBuffers.allBuffers) {
|
||||
buffer.open();
|
||||
}
|
||||
|
@ -523,9 +526,9 @@ export default class BufferSyncSupport extends Disposable {
|
|||
if (this.pendingGetErr) {
|
||||
this.pendingGetErr.cancel();
|
||||
|
||||
for (const file of this.pendingGetErr.files.entries) {
|
||||
if (this.syncedBuffers.get(file.resource)) {
|
||||
orderedFileSet.set(file.resource, undefined);
|
||||
for (const { resource } of this.pendingGetErr.files.entries) {
|
||||
if (this.syncedBuffers.get(resource)) {
|
||||
orderedFileSet.set(resource, undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
|||
|
||||
private populateService(): void {
|
||||
this.fileConfigurationManager.reset();
|
||||
this.client.bufferSyncSupport.reOpenDocuments();
|
||||
this.client.bufferSyncSupport.reset();
|
||||
this.client.bufferSyncSupport.requestAllDiagnostics();
|
||||
|
||||
// See https://github.com/Microsoft/TypeScript/issues/5530
|
||||
|
|
Loading…
Reference in a new issue