Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 7777d8a

Browse files
tomv564felixfbecker
authored andcommitted
perf: delay diagnostics to give priority to other client requests (#345)
1 parent bd29fc3 commit 7777d8a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/typescript-service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ export class TypeScriptService {
12671267
// Ensure files needed for most operations are fetched
12681268
await this.projectManager.ensureReferencedFiles(uri).toPromise();
12691269
this.projectManager.didOpen(uri, params.textDocument.text);
1270+
await new Promise(resolve => setTimeout(resolve, 200));
12701271
this._publishDiagnostics(uri);
12711272
}
12721273

@@ -1288,6 +1289,7 @@ export class TypeScriptService {
12881289
return;
12891290
}
12901291
this.projectManager.didChange(uri, text);
1292+
await new Promise(resolve => setTimeout(resolve, 200));
12911293
this._publishDiagnostics(uri);
12921294
}
12931295

0 commit comments

Comments
 (0)