From fa87b159035dd3c393537c7e40837dd85095224f Mon Sep 17 00:00:00 2001 From: Remi Schnekenburger Date: Thu, 19 Sep 2024 10:59:46 +0200 Subject: [PATCH] [vscode] TreeView reveal options are now readonly fixes #14109 Contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger --- CHANGELOG.md | 1 + .../plugin-ext/src/common/plugin-api-rpc.ts | 6 ++--- packages/plugin/src/theia.d.ts | 24 ++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913dce7b1602f..f88a821de203c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [core] Updated AuthenticationService to handle multiple accounts per provider [#14149](https://github.com/eclipse-theia/theia/pull/14149) - Contributed on behalf of STMicroelectronics diff --git a/packages/plugin-ext/src/common/plugin-api-rpc.ts b/packages/plugin-ext/src/common/plugin-api-rpc.ts index dab7e870d0251..26bb12f82492b 100644 --- a/packages/plugin-ext/src/common/plugin-api-rpc.ts +++ b/packages/plugin-ext/src/common/plugin-api-rpc.ts @@ -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 { diff --git a/packages/plugin/src/theia.d.ts b/packages/plugin/src/theia.d.ts index 6caa690fdacf1..caaf147b163b4 100644 --- a/packages/plugin/src/theia.d.ts +++ b/packages/plugin/src/theia.d.ts @@ -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; + 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; } /**