From 561b8364008a8fd12e0259989b6cc3be9481bcc7 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Wed, 26 May 2021 15:56:52 -0700 Subject: [PATCH] testing: fix hidden tests not being un-hidable Fixes #124544 --- .../testing/browser/testingExplorerView.ts | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts index dee91b50691..d8484503bc5 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts @@ -539,7 +539,7 @@ export class TestingExplorerViewModel extends Disposable { return; } - const actions = getActionableElementActions(this.contextKeyService, this.menuService, element); + const actions = getActionableElementActions(this.contextKeyService, this.menuService, this.testService, element); this.contextMenuService.showContextMenu({ getAnchor: () => evt.anchor, getActions: () => [ @@ -949,6 +949,7 @@ abstract class ActionableItemTemplateData protected readonly labels: ResourceLabels, private readonly actionRunner: TestExplorerActionRunner, private readonly menuService: IMenuService, + protected readonly testService: ITestService, private readonly contextKeyService: IContextKeyService, private readonly instantiationService: IInstantiationService, ) { @@ -1006,7 +1007,7 @@ abstract class ActionableItemTemplateData } private fillActionBar(element: T, data: IActionableElementTemplateData) { - const actions = getActionableElementActions(this.contextKeyService, this.menuService, element); + const actions = getActionableElementActions(this.contextKeyService, this.menuService, this.testService, element); data.elementDisposable.push(actions); data.actionBar.clear(); data.actionBar.context = element; @@ -1021,11 +1022,11 @@ class TestItemRenderer extends ActionableItemTemplateData { labels: ResourceLabels, actionRunner: TestExplorerActionRunner, @IMenuService menuService: IMenuService, + @ITestService testService: ITestService, @IContextKeyService contextKeyService: IContextKeyService, @IInstantiationService instantiationService: IInstantiationService, - @ITestService private readonly testService: ITestService ) { - super(labels, actionRunner, menuService, contextKeyService, instantiationService); + super(labels, actionRunner, menuService, testService, contextKeyService, instantiationService); } /** @@ -1083,16 +1084,6 @@ const formatDuration = (ms: number) => { class WorkspaceFolderRenderer extends ActionableItemTemplateData { public static readonly ID = 'workspaceFolder'; - constructor( - labels: ResourceLabels, - actionRunner: TestExplorerActionRunner, - @IMenuService menuService: IMenuService, - @IContextKeyService contextKeyService: IContextKeyService, - @IInstantiationService instantiationService: IInstantiationService, - ) { - super(labels, actionRunner, menuService, contextKeyService, instantiationService); - } - /** * @inheritdoc */ @@ -1120,6 +1111,7 @@ class WorkspaceFolderRenderer extends ActionableItemTemplateData { const test = element instanceof TestItemTreeElement ? element.test : undefined; @@ -1127,6 +1119,7 @@ const getActionableElementActions = ( ['view', Testing.ExplorerViewId], [TestingContextKeys.testItemExtId.key, test?.item.extId], [TestingContextKeys.testItemHasUri.key, !!test?.item.uri], + [TestingContextKeys.testItemIsHidden.key, !!test && testService.excludeTests.value.has(test.item.extId)], [TestingContextKeys.hasDebuggableTests.key, !Iterable.isEmpty(element.debuggable)], [TestingContextKeys.hasRunnableTests.key, !Iterable.isEmpty(element.runnable)], ]);