-
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
Allow to reveal an empty TreeView programmatically #90005
Comments
(Experimental duplicate detection) |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
Proposal is to allow the first parameter here to be undefined: vscode/src/vs/vscode.proposed.d.ts Lines 1042 to 1044 in e95c40c
|
I think we should add a show(preserveFocus?: boolean): void; I also think we should add a |
I think that could result in this pattern: let element: T | undefined;
// ... element gets set to something
if (element) {
tree.reveal(element);
} else {
tree.show();
} |
It could, but imo that still feels more right to me. Also the |
I'd prefer to simply allow the reveal element to be undefined (as currently proposed). A questionable alternative is to allow an overload to export interface TreeView<T> extends Disposable {
reveal(options?: { element?: T, select?: boolean, focus?: boolean, expand?: boolean | number }): Thenable<void>;
} note: the issue with the overload is that it can clash with the existing reveal definition if the properties of Another option is a reveal overload without any arguments. export interface TreeView<T> extends Disposable {
reveal(): Thenable<void>;
} I think a |
I tried to pass a null to reveal, it can switch the treeview normally, which has met my needs.
|
IMHO the overload of To reveal an item inside a view is view specific, whereas to make the view itself visible is something that applies to any view at all. The fact that The options in |
As a driver for this behavior, I want to implement a command that shows a custom tree view in the same way that any of the other views are shown. You can do this manually via View -> Open view... -> . This is the behavior that |
Lol, I propose that an alias of |
Indeed, a dedicated |
Currently, it i possible to reveal/expand a TreeView only when there is an element in the TreeView. it is oputting revealing this element in the TreeView.
it would useful to be abel to expand the TreeView even when there are no elements in the Tree.
Use case:
asked on StackOverflow https://stackoverflow.com/questions/59983711/how-to-programmatically-make-a-treeview-visible
The text was updated successfully, but these errors were encountered: