From d6448cfd3adb8eee04a8eef5c50576de045380e2 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Tue, 30 Mar 2021 12:18:18 -0700 Subject: [PATCH] testing: fix test welcome being shown at inappropriate times Fixes #119675 --- .../contrib/testing/browser/testingExplorerView.ts | 1 + .../workbench/contrib/testing/common/testServiceImpl.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts index 295405bc3de..3bea3666ab8 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts @@ -521,6 +521,7 @@ export class TestingExplorerViewModel extends Disposable { private shouldShowEmptyPlaceholder() { return !!this.listener && this.listener.subscription.busyProviders === 0 + && this.listener.subscription.pendingRootProviders === 0 && this.listener.subscription.isEmpty; } diff --git a/src/vs/workbench/contrib/testing/common/testServiceImpl.ts b/src/vs/workbench/contrib/testing/common/testServiceImpl.ts index 808fd5f07c8..68f2b1d22a9 100644 --- a/src/vs/workbench/contrib/testing/common/testServiceImpl.ts +++ b/src/vs/workbench/contrib/testing/common/testServiceImpl.ts @@ -233,6 +233,7 @@ export class TestService extends Disposable implements ITestService { this.unsubscribeEmitter.fire(subscription.ident); const diff = subscription.collection.clear(); subscription.onDiff.fire(diff); + subscription.collection.pendingRootProviders = this.rootProviders.size; this.subscribeEmitter.fire(subscription.ident); } } @@ -358,6 +359,14 @@ export class MainThreadTestCollection extends AbstractIncrementalTestCollection< return this.pendingRootCount; } + /** + * Sets the number of pending root providers. + */ + public set pendingRootProviders(count: number) { + this.pendingRootCount = count; + this.pendingRootChangeEmitter.fire(count); + } + /** * @inheritdoc */