Change:
Testing Open in VS Code Insiders Search for "containers" Exploring results and collapsing/uncollapsing works for a while :bug: Then "Collapse All" does nothing !
It seems I'm able to repro by: Reload window from above state Search for "containers" again, works correctly "Collapse All," works correctly Uncollapse, works correctly Try "Collapse All" again, stuck in unresponsive state above
Actually seems I misread the button - I guess it's always "Collapse All" and doesn't become an option to uncollapse. I was confused since hitting collapse two times in a row changes the search results, so I assumed it was collapsing and then uncollapsing. Not sure if this is expected: ! I've renamed the issue to be reflective of what I actually experienced. If this is expected, please feel free to close. Sorry for confusion!
No, that's totally a bug , it shouldn't get stuck like that. Thanks for catching that!

Discussion:
let canCollapseFileMatchLevel = false; let canCollapseFirstLevel = false; <del> if (node instanceof FolderMatch) { </del> <ins> if (node instanceof FolderMatchWorkspaceRoot) { </ins> while (node = navigator.next()) { if (node instanceof Match) { canCollapseFileMatchLevel = true; break; } if (searchView.isTreeLayoutViewVisible && !canCollapseFirstLevel) { <del> const immediateParent = node.parent(); </del> <ins> let nodeToTest = node; if (node instanceof FolderMatch) { nodeToTest = node.compressionStartParent ?? node; } const immediateParent = nodeToTest.parent(); </ins> if (!(immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot || immediateParent instanceof SearchResult)) { canCollapseFirstLevel = true; }

node = navigator.first(); if (node) { do { <del> const immediateParent = node.parent(); </del> <ins> let nodeToTest = node; if (node instanceof FolderMatch) { nodeToTest = node.compressionStartParent ?? node; } const immediateParent = nodeToTest.parent(); </ins> if (immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot) { if (viewer.hasElement(node)) { viewer.collapse(node, true);

renderCompressedElements(node: ITreeNode<ICompressedTreeNode<FolderMatch>, any>, index: number, templateData: IFolderMatchTemplate, height: number | undefined): void { const compressed = node.element; const folder = compressed.elements[compressed.elements.length - 1]; <ins> folder.compressionStartParent = compressed.elements[0]; </ins> const label = compressed.elements.map(e => e.name()); if (folder.resource) {

renderElement(node: ITreeNode<FolderMatch, any>, index: number, templateData: IFolderMatchTemplate): void { const folderMatch = node.element; <ins> folderMatch.compressionStartParent = undefined; </ins> if (folderMatch.resource) { const workspaceFolder = this.contextService.getWorkspaceFolder(folderMatch.resource); if (workspaceFolder && isEqual(workspaceFolder.uri, folderMatch.resource)) {

protected _unDisposedFileMatches: ResourceMap<FileMatch>; protected _unDisposedFolderMatches: ResourceMap<FolderMatchWithResource>; private _replacingAll: boolean = false; <ins> // if this is compressed in a node with other FolderMatches, then this is set to the parent where compression starts public compressionStartParent: FolderMatch | undefined; </ins> constructor( protected _resource: URI | null, private _id: string,