Skip to content

Commit

Permalink
[vscode] TreeView reveal options are now readonly (#14198)
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 authored Sep 23, 2024
1 parent 88b64b2 commit eaf6786
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 @@ -8,6 +8,7 @@
- [plugin] move stubbed API TerminalShellIntegration into main API [#14168](https://github.com/eclipse-theia/theia/pull/14168) - Contributed on behalf of STMicroelectronics
- [plugin] support evolution on proposed API extensionAny [#14199](https://github.com/eclipse-theia/theia/pull/14199) - 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
- [test] support TestMessage stack traces [#14154](https://github.com/eclipse-theia/theia/pull/14154) - Contributed on behalf of STMicroelectronics
<a name="breaking_changes_1.54.0">[Breaking Changes:](#breaking_changes_1.54.0)</a> -->
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:* In VS Code, you can expand only to 3 levels maximum. This is not the case in Theia, there are no limits to expansion level.
* * *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 eaf6786

Please sign in to comment.