From 2cb6f27d84e9e72176a91f4b97573ebfd42e30db Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 2 Aug 2021 12:47:10 -0700 Subject: [PATCH] fix: improve test explorer active document filtering to exclude childless peers Fixes #129476 --- .../contrib/testing/browser/testingExplorerView.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts index 52000033939..2f62c95978b 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts @@ -748,14 +748,17 @@ const hasNodeInOrParentOfUri = (collection: IMainThreadTestCollection, testUri: continue; } - if (!node.item.uri) { - queue.push(node.children); + if (!node.item.uri || !extpath.isEqualOrParent(fsPath, node.item.uri.fsPath)) { continue; } - if (extpath.isEqualOrParent(fsPath, node.item.uri.fsPath)) { + // Only show nodes that can be expanded (and might have a child with + // a range) or ones that have a physical location. + if (node.item.range || node.expand === TestItemExpandState.Expandable) { return true; } + + queue.push(node.children); } }