Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree - support expandAll or equivalent #64887

Closed
jrieken opened this issue Dec 12, 2018 · 3 comments
Closed

tree - support expandAll or equivalent #64887

jrieken opened this issue Dec 12, 2018 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality tree-widget Tree widget issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@jrieken
Copy link
Member

jrieken commented Dec 12, 2018

re #64727

When filtering or find items in the outline all matches are highlighted and revealed. See https://github.com/Microsoft/vscode/blob/ca773cb3f27afd57b0bd790d2e2f33f261a31030/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts#L570-L577

There is no equivalent in the new tree, except for calling expand in a loop. After #64807 (comment) I am not sure anymore that's OK to do

@joaomoreno
Copy link
Member

We can easily do this in the ObjectTree now. I can even add in the Alt clicking that would do this per subtree.

@joaomoreno joaomoreno added this to the December 2018 milestone Dec 12, 2018
@joaomoreno joaomoreno added feature-request Request for new features or functionality tree-widget Tree widget issues labels Dec 12, 2018
joaomoreno added a commit that referenced this issue Dec 14, 2018
@joaomoreno
Copy link
Member

Alright did a pretty big revamp of the collapse feature set in the tree:

  • Introduced expandAll
  • Introduced a recursive flag for setCollapsed and toggleCollapsed
  • Holding Alt while expanding/collapsing a node via mouse click or Spacebar will now perform the action recursively, just like in native tree widgets (finally we get this!).

Here's the current full extent of collapse related methods of the tree:

collapse(location: TRef, recursive: boolean = false): boolean;
expand(location: TRef, recursive: boolean = false): boolean;
toggleCollapsed(location: TRef, recursive: boolean = false): boolean;
expandAll(): void;
collapseAll(): void;
isCollapsible(location: TRef): boolean;
isCollapsed(location: TRef): boolean;

cc @isidorn @roblourens

@isidorn
Copy link
Contributor

isidorn commented Dec 14, 2018

@joaomoreno any chance that you support expandAll(elements?: T[])
Currently I have to do the following
https://github.com/Microsoft/vscode/blob/ab0b87329f1e5c89f1df6e50c5a4b7e7a37006dc/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts#L970

Also that expand and others throw errors when an element is not there is forcing me to use these ugly ignoreErrors approach.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 28, 2019
@joaomoreno joaomoreno added the verification-needed Verification of issue is requested label Jan 28, 2019
@jrieken jrieken added the verified Verification succeeded label Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality tree-widget Tree widget issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants