From 02746fe8fb65e0e4a97a8260650362cdc9570ddb Mon Sep 17 00:00:00 2001 From: Remi Schnekenburger Date: Thu, 19 Sep 2024 12:34:49 +0200 Subject: [PATCH] Support evolution on proposed API extensionAny fixes #14115 contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger --- CHANGELOG.md | 1 + packages/plugin-ext/src/plugin/plugin-context.ts | 2 +- packages/plugin/src/theia.proposed.extensionsAny.d.ts | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913dce7b1602f..fa6192fe5cd7f 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/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts index e4bfae6643065..bb19d777fb058 100644 --- a/packages/plugin-ext/src/plugin/plugin-context.ts +++ b/packages/plugin-ext/src/plugin/plugin-context.ts @@ -884,7 +884,7 @@ export function createAPIFactory( const extensions: typeof theia.extensions = Object.freeze({ // eslint-disable-next-line @typescript-eslint/no-explicit-any - getExtension(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension | undefined { + getExtension(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension | undefined { includeFromDifferentExtensionHosts = false; const plg = pluginManager.getPluginById(extensionId.toLowerCase()); if (plg) { diff --git a/packages/plugin/src/theia.proposed.extensionsAny.d.ts b/packages/plugin/src/theia.proposed.extensionsAny.d.ts index 7d05daae7341e..565cf80dd20b9 100644 --- a/packages/plugin/src/theia.proposed.extensionsAny.d.ts +++ b/packages/plugin/src/theia.proposed.extensionsAny.d.ts @@ -41,9 +41,13 @@ export module '@theia/plugin' { * @param extensionId An extension identifier. * @param includeDifferentExtensionHosts Include extensions from different extension host * @return An extension or `undefined`. + * + * *Note* In Theia, includeDifferentExtensionHosts will always be set to false, as we only support one host currently. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function getExtension(extensionId: string, includeDifferentExtensionHosts: boolean): Extension | undefined; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + export function getExtension(extensionId: string, includeDifferentExtensionHosts: true): Extension | undefined; /** * All extensions across all extension hosts.