-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Additions to Tree view API #52300
Closed
Closed
Additions to Tree view API #52300
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
76d99c7
selection change event
sandy081 bac400f
Add support for visibility and focus
sandy081 d0d3915
Add doc
sandy081 5538c6e
update doc
sandy081 8af16b5
Introduce double click command
sandy081 71659f2
Code review feedback and remove double click command
sandy081 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6079,6 +6079,30 @@ declare module 'vscode' { | |
|
||
} | ||
|
||
/** | ||
* The event that is fired when there is a change in [tree view's selection](#TreeView.selection) | ||
*/ | ||
export interface TreeViewSelectionChangeEvent<T> { | ||
|
||
/** | ||
* Selected elements. | ||
*/ | ||
selection: T[]; | ||
|
||
} | ||
|
||
/** | ||
* The event that is fired when there is a change in [tree view's visibility](#TreeView.visible) | ||
*/ | ||
export interface TreeViewVisibilityChangeEvent { | ||
|
||
/** | ||
* `true` if the [tree view](#TreeView) is visible otherwise `false`. | ||
*/ | ||
visible: boolean; | ||
|
||
} | ||
|
||
/** | ||
* Represents a Tree view | ||
*/ | ||
|
@@ -6097,19 +6121,36 @@ declare module 'vscode' { | |
/** | ||
* Currently selected elements. | ||
*/ | ||
readonly selection: ReadonlyArray<T>; | ||
readonly selection: T[]; | ||
|
||
/** | ||
* Reveal an element. By default revealed element is selected. | ||
* Event that is fired when the [selection](#TreeView.selection) has changed | ||
*/ | ||
readonly onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>; | ||
|
||
/** | ||
* `true` if the [tree view](#TreeView) is visible otherwise `false`. | ||
*/ | ||
readonly visible: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only means There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
|
||
/** | ||
* Event that is fired when [visibility](TreeView.visible) has changed | ||
*/ | ||
readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>; | ||
|
||
/** | ||
* 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`. | ||
* | ||
* **NOTE:** [TreeDataProvider](#TreeDataProvider) is required to implement [getParent](#TreeDataProvider.getParent) method to access this API. | ||
*/ | ||
reveal(element: T, options?: { select?: boolean }): Thenable<void>; | ||
reveal(element: T, options?: { select?: boolean, focus?: boolean }): Thenable<void>; | ||
} | ||
|
||
|
||
/** | ||
* A data provider that provides tree data | ||
*/ | ||
|
@@ -6183,7 +6224,7 @@ declare module 'vscode' { | |
tooltip?: string | undefined; | ||
|
||
/** | ||
* The [command](#Command) which should be run when the tree item is selected. | ||
* The [command](#Command) that should be executed when the tree item is selected. | ||
*/ | ||
command?: Command; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
readonly
and?ReadonlyArray<T>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there in last milestone. Hope the change will not break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just
readonly
should be enough and non breaking