Skip to content

Commit cd0e5af

Browse files
committed
Support evolution on proposed API extensionAny
fixes eclipse-theia#14115 contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <[email protected]>
1 parent b8ecd13 commit cd0e5af

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!-- ## Unreleased
88
99
- [plugin] move stubbed API TerminalShellIntegration into main API [#14168](https://github.com/eclipse-theia/theia/pull/14168) - Contributed on behalf of STMicroelectronics
10+
- [plugin] support evolution on proposed API extensionAny [#14199](https://github.com/eclipse-theia/theia/pull/14199) - Contributed on behalf of STMicroelectronics
1011
1112
<a name="breaking_changes_1.54.0">[Breaking Changes:](#breaking_changes_1.54.0)</a> -->
1213
- [core] Updated AuthenticationService to handle multiple accounts per provider [#14149](https://github.com/eclipse-theia/theia/pull/14149) - Contributed on behalf of STMicroelectronics

packages/plugin-ext/src/plugin/plugin-context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ export function createAPIFactory(
884884

885885
const extensions: typeof theia.extensions = Object.freeze({
886886
// eslint-disable-next-line @typescript-eslint/no-explicit-any
887-
getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T> | undefined {
887+
getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T | undefined> | undefined {
888888
includeFromDifferentExtensionHosts = false;
889889
const plg = pluginManager.getPluginById(extensionId.toLowerCase());
890890
if (plg) {

packages/plugin/src/theia.proposed.extensionsAny.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ export module '@theia/plugin' {
4141
* @param extensionId An extension identifier.
4242
* @param includeDifferentExtensionHosts Include extensions from different extension host
4343
* @return An extension or `undefined`.
44+
*
45+
* *Note* In Theia, includeDifferentExtensionHosts will always be set to false, as we only support one host currently.
4446
*/
4547
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4648
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: boolean): Extension<T> | undefined;
49+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
50+
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: true): Extension<T | undefined> | undefined;
4751

4852
/**
4953
* All extensions across all extension hosts.

0 commit comments

Comments
 (0)