Skip to content

Commit

Permalink
[vscode] TreeView reveal options are now readonly
Browse files Browse the repository at this point in the history
fixes #14109

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu committed Sep 19, 2024
1 parent 4a0228b commit fa87b15
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- ## Unreleased
- [plugin] move stubbed API TerminalShellIntegration into main API [#14168](https://github.com/eclipse-theia/theia/pull/14168) - Contributed on behalf of STMicroelectronics
- [plugin] updated TreeView reveal options to be readonly [#14198](https://github.com/eclipse-theia/theia/pull/14198) - Contributed on behalf of STMicroelectronics
<a name="breaking_changes_1.54.0">[Breaking Changes:](#breaking_changes_1.54.0)</a> -->
- [core] Updated AuthenticationService to handle multiple accounts per provider [#14149](https://github.com/eclipse-theia/theia/pull/14149) - Contributed on behalf of STMicroelectronics
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-ext/src/common/plugin-api-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,9 @@ export interface RegisterTreeDataProviderOptions {
}

export interface TreeViewRevealOptions {
select: boolean
focus: boolean
expand: boolean | number
readonly select: boolean
readonly focus: boolean
readonly expand: boolean | number
}

export interface TreeViewsMain {
Expand Down
24 changes: 21 additions & 3 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6728,13 +6728,31 @@ export module '@theia/plugin' {
badge: ViewBadge | undefined;

/**
* Reveal an element. By default revealed element is selected.
* 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.
* 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`. To expand recursively set `expand` to the number of levels to expand.
*
* **NOTE:** {@link TreeDataProvider TreeDataProvider} is required to implement {@link TreeDataProvider.getParent getParent} method to access this API.
* * *NOTE:* You can expand only to 3 levels maximum.
* * *NOTE:* The {@link TreeDataProvider} that the `TreeView` {@link window.createTreeView is registered with} with must implement {@link TreeDataProvider.getParent getParent} method to access this API.
*/
reveal(element: T, options?: { select?: boolean; focus?: boolean; expand?: boolean | number }): Thenable<void>;
reveal(element: T, options?: {
/**
* If true, then the element will be selected.
*/
readonly select?: boolean;
/**
* If true, then the element will be focused.
*/
readonly focus?: boolean;
/**
* If true, then the element will be expanded. If a number is passed, then up to that number of levels of children will be expanded
*/
readonly expand?: boolean | number;
}): Thenable<void>;
}

/**
Expand Down

0 comments on commit fa87b15

Please sign in to comment.