提交 a5f28dd1 编写于 作者: D Dirk Baeumer

Fixes #7097: TypeScript should revalidate all files that were open in an editor

上级 bf20fc2a
......@@ -74,7 +74,8 @@ export default class BufferSyncSupport {
private _validate: boolean;
private modeIds: Map<boolean>;
private disposables: Disposable[] = [];
private syncedBuffers: { [key: string]: SyncedBuffer };
private syncedBuffers: Map<SyncedBuffer>;
private closedFiles: Map<boolean>;
private pendingDiagnostics: { [key: string]: number; };
private diagnosticDelayer: Delayer<any>;
......@@ -89,6 +90,7 @@ export default class BufferSyncSupport {
this.diagnosticDelayer = new Delayer<any>(100);
this.syncedBuffers = Object.create(null);
this.closedFiles = Object.create(null);
}
public listen(): void {
......@@ -136,6 +138,7 @@ export default class BufferSyncSupport {
}
let syncedBuffer = new SyncedBuffer(document, filepath, this, this.client);
this.syncedBuffers[filepath] = syncedBuffer;
delete this.closedFiles[filepath];
syncedBuffer.open();
this.requestDiagnostic(filepath);
}
......@@ -149,6 +152,7 @@ export default class BufferSyncSupport {
if (!syncedBuffer) {
return;
}
this.closedFiles[filepath] = true;
delete this.syncedBuffers[filepath];
syncedBuffer.close();
}
......@@ -207,6 +211,13 @@ export default class BufferSyncSupport {
}
});
// Now add all files that we have requested diagnostics for but are now
// closed. Otherwise it might be confusing that interfile dependent markers
// don't get fixed.
Object.keys(this.closedFiles).forEach((file) => {
files.push(file);
});
let args: Proto.GeterrRequestArgs = {
delay: 0,
files: files
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册