Skip to content

Commit

Permalink
Support evolution on proposed API extensionAny
Browse files Browse the repository at this point in the history
fixes #14115

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu committed Sep 19, 2024
1 parent b8ecd13 commit 02746fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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] support evolution on proposed API extensionAny [#14199](https://github.com/eclipse-theia/theia/pull/14199) - 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
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ export function createAPIFactory(

const extensions: typeof theia.extensions = Object.freeze({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T> | undefined {
getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T | undefined> | undefined {
includeFromDifferentExtensionHosts = false;
const plg = pluginManager.getPluginById(extensionId.toLowerCase());
if (plg) {
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin/src/theia.proposed.extensionsAny.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T = any>(extensionId: string, includeDifferentExtensionHosts: boolean): Extension<T> | undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: true): Extension<T | undefined> | undefined;

/**
* All extensions across all extension hosts.
Expand Down

0 comments on commit 02746fe

Please sign in to comment.