mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:04:14 +08:00
tree: collapsed visible node should still recurse when filtering
This commit is contained in:
parent
60ba9db9d7
commit
a55274bf18
@ -309,7 +309,7 @@ export class TreeModel<T, TFilterData = void> {
|
||||
node.revealedCount = node === this.root ? 0 : 1;
|
||||
|
||||
let hasVisibleDescendants = false;
|
||||
if (typeof node.visible === 'undefined' || !node.collapsed) {
|
||||
if (node.visible !== false || !node.collapsed) {
|
||||
for (const child of node.children) {
|
||||
hasVisibleDescendants = this._updateNodeAfterFilterChange(child, result, revealed && !node.collapsed) || hasVisibleDescendants;
|
||||
}
|
||||
|
||||
@ -538,6 +538,16 @@ suite('TreeModel2', function () {
|
||||
|
||||
model.setCollapsed([0], false);
|
||||
assert.deepEqual(toArray(list), ['vscode', 'build', 'gulpfile.js']);
|
||||
|
||||
model.setCollapsed([0], true);
|
||||
assert.deepEqual(toArray(list), ['vscode']);
|
||||
|
||||
query = new RegExp('');
|
||||
model.refilter();
|
||||
assert.deepEqual(toArray(list), ['vscode']);
|
||||
|
||||
model.setCollapsed([0], false);
|
||||
assert.deepEqual(list.length, 10);
|
||||
});
|
||||
|
||||
suite('getNodeLocation', function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user