fix: improve test explorer active document filtering to exclude childless peers

Fixes #129476
This commit is contained in:
Connor Peet 2021-08-02 12:47:10 -07:00
parent 9350fa3c9d
commit 2cb6f27d84
No known key found for this signature in database
GPG key ID: CF8FD2EA0DBC61BD

View file

@ -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);
}
}