Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] Support evolution on proposed API extensionAny #14199

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is actually not true: we support at least two different extension hosts: front-end and back-end. Back in the Che days, there was even support for remote-calling the extension interface via RPC.

*/
// 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
Loading