Skip to content

Commit 49f4bc2

Browse files
committed
Windows sucks
1 parent 37fbd35 commit 49f4bc2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

language-server/src/test/test-client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ export class TestClient<Configuration> {
247247
const buildCompleted = this.buildCompleted();
248248

249249
if (this.watchEnabled) {
250+
console.log("Send DidChangeWatchedFiles");
250251
await this.client.sendNotification(DidChangeWatchedFilesNotification.type, {
251252
changes: [{
252253
type: exists ? FileChangeType.Changed : FileChangeType.Created,
@@ -308,12 +309,20 @@ export class TestClient<Configuration> {
308309
});
309310
}
310311

312+
private builds = 0;
313+
311314
// TODO: Duplicated code
312315
private buildCompleted() {
313316
return new Promise<void>((resolve) => {
314317
this.client.onRequest(WorkDoneProgressCreateRequest.type, ({ token }) => {
315318
this.client.onProgress(WorkDoneProgress.type, token, ({ kind }) => {
316-
if (kind === "end") {
319+
if (kind === "begin") {
320+
this.builds++;
321+
} else if (kind === "end") {
322+
this.builds--;
323+
}
324+
325+
if (this.builds === 0) {
317326
resolve();
318327
}
319328
});

0 commit comments

Comments
 (0)