-
Notifications
You must be signed in to change notification settings - Fork 30k
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
API to expand/collapse custom TreeItems #55879
Comments
@eamodio Need of this API is to implement a global expand or collapse all actions? Or is there other requirements? Edit: Ignore the comment, I see the requests in the other mentioned issue |
@sandy081 is there anyway to get this bumped up from the backlog? I know a few other extension devs anxiously awaiting this 😄 |
Planning for October :) |
@eamodio Here is the plan to support this. Took your suggestion to support expand using
|
Will expand be 1 level or all levels? |
1 level and not recursive. |
Any chance for Where it is fully recursive when gitkraken/vscode-gitlens#275 requires a recursive expansion |
Recursive expand has the potential for performance suicide that's why we are pushing back on it. The |
Ah, yeah, that make a lot of sense. I think in most cases, having the option to expand the item or the item and its children is probably enough. |
@eamodio So you would still want the I think expanding just an element will suffice most of the cases and if want to expand one more level you can iterate over children and call reveal? |
Only up to the items children. Where am I getting the list of children to iterate over to then reveal? Do I have to call |
Ok. I will allow the API to take number of levels
|
/**
* Reveals the given element in the tree view.
* If the tree view is not visible then the tree view is shown and element is revealed.
*
* By default revealed element is selected and not focused.
* In order to not to select, set the option `select` to `false`.
* In order to focus, set the option `focus` to `true`.
* In order to expand the revealed element, set the option `expand` to `true` or `1`. To expand recursively set `expand` to the number of levels to expand.
* **NOTE:** You can recursively expand to maximum only 3 levels.
*
* **NOTE:** [TreeDataProvider](#TreeDataProvider) is required to implement [getParent](#TreeDataProvider.getParent) method to access this API.
*/
reveal(element: T, options?: { select?: boolean, focus?: boolean, expand?: boolean | 1 | 2 | 3 }): Thenable<void>; |
I am looking for an API to expand or collapse a specified TreeItem (both deep and shallow).
For example, I would like to provide a Collapse All command for some of my trees to provide a deep collapse (all descendants from the specified item should collapse). Same with expand.
Here are a few more examples: #30288 (comment), gitkraken/vscode-gitlens#383, gitkraken/vscode-gitlens#275
Something similar to
reveal
that would allow for specifying deep (affects all descendants) or not.The text was updated successfully, but these errors were encountered: