mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-07 07:16:41 +01:00
Simplify pendingDiagnostics sort
This commit is contained in:
@@ -153,7 +153,7 @@ export default class BufferSyncSupport {
|
||||
private readonly disposables: Disposable[] = [];
|
||||
private readonly syncedBuffers: SyncedBufferMap;
|
||||
|
||||
private pendingDiagnostics = new Map<string, number>();
|
||||
private readonly pendingDiagnostics = new Map<string, number>();
|
||||
private readonly diagnosticDelayer: Delayer<any>;
|
||||
|
||||
constructor(
|
||||
@@ -271,16 +271,9 @@ export default class BufferSyncSupport {
|
||||
if (!this._validate) {
|
||||
return;
|
||||
}
|
||||
let files = Array.from(this.pendingDiagnostics.entries()).map(([key, value]) => {
|
||||
return {
|
||||
file: key,
|
||||
time: value
|
||||
};
|
||||
}).sort((a, b) => {
|
||||
return a.time - b.time;
|
||||
}).map((value) => {
|
||||
return value.file;
|
||||
});
|
||||
const files = Array.from(this.pendingDiagnostics.entries())
|
||||
.sort((a, b) => a[1] - b[1])
|
||||
.map(entry => entry[0]);
|
||||
|
||||
// Add all open TS buffers to the geterr request. They might be visible
|
||||
for (const file of this.syncedBuffers.allResources) {
|
||||
|
||||
Reference in New Issue
Block a user