Skip to content

Commit

Permalink
fix: regressions from headless plugins refactoring
Browse files Browse the repository at this point in the history
- fix gaps in Inversify DI configuration in the web worker for
  frontend plugins
- restore the onDidDeploy() dorwarding lost in the refactoring for
  headless plugins

Fixes #13320

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
Co-authored-by: Christian W. Damus <cdamus.ext@eclipsesource.com>
  • Loading branch information
xai and cdamus committed Jan 31, 2024
1 parent 69d7cd0 commit d3e52f7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 39 deletions.
1 change: 1 addition & 0 deletions packages/plugin-ext/src/hosted/browser/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
}

protected override afterStart(): void {
this.watcher.onDidDeploy(() => this.load());
this.server.onDidOpenConnection(() => this.load());
}

Expand Down
29 changes: 0 additions & 29 deletions packages/plugin-ext/src/hosted/browser/worker/debug-stub.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/plugin-ext/src/hosted/browser/worker/worker-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import * as theia from '@theia/plugin';
import { emptyPlugin, MAIN_RPC_CONTEXT, Plugin } from '../../../common/plugin-api-rpc';
import { ExtPluginApi } from '../../../common/plugin-ext-api-contribution';
import { getPluginId, PluginMetadata } from '../../../common/plugin-protocol';
import { RPCProtocol, RPCProtocolImpl } from '../../../common/rpc-protocol';
import { RPCProtocol } from '../../../common/rpc-protocol';
import { ClipboardExt } from '../../../plugin/clipboard-ext';
import { EditorsAndDocumentsExtImpl } from '../../../plugin/editors-and-documents';
import { MessageRegistryExt } from '../../../plugin/message-registry';
Expand Down Expand Up @@ -56,7 +56,7 @@ function initialize(contextPath: string, pluginMetadata: PluginMetadata): void {
const container = new Container();
container.load(pluginHostModule);

const rpc: RPCProtocol = container.get(RPCProtocolImpl);
const rpc: RPCProtocol = container.get(RPCProtocol);
const pluginManager = container.get(PluginManagerExtImpl);
pluginManager.setPluginHost({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ import { RPCProtocol, RPCProtocolImpl } from '../../../common/rpc-protocol';
import { ClipboardExt } from '../../../plugin/clipboard-ext';
import { EditorsAndDocumentsExtImpl } from '../../../plugin/editors-and-documents';
import { MessageRegistryExt } from '../../../plugin/message-registry';
import { PluginManagerExtImpl } from '../../../plugin/plugin-manager';
import { KeyValueStorageProxy } from '../../../plugin/plugin-storage';
import { MinimalTerminalServiceExt, PluginManagerExtImpl } from '../../../plugin/plugin-manager';
import { InternalStorageExt, KeyValueStorageProxy } from '../../../plugin/plugin-storage';
import { PreferenceRegistryExtImpl } from '../../../plugin/preference-registry';
import { SecretsExtImpl } from '../../../plugin/secrets-ext';
import { InternalSecretsExt, SecretsExtImpl } from '../../../plugin/secrets-ext';
import { TerminalServiceExtImpl } from '../../../plugin/terminal-ext';
import { WebviewsExtImpl } from '../../../plugin/webviews';
import { WorkspaceExtImpl } from '../../../plugin/workspace';
import { createDebugExtStub } from './debug-stub';
import { EnvExtImpl } from '../../../plugin/env';
import { WorkerEnvExtImpl } from './worker-env-ext';
import { DebugExtImpl } from '../../../plugin/debug/debug-ext';
Expand Down Expand Up @@ -58,16 +57,19 @@ export default new ContainerModule(bind => {

bind(PluginManagerExtImpl).toSelf().inSingletonScope();
bind(EnvExtImpl).to(WorkerEnvExtImpl).inSingletonScope();
bind(LocalizationExt).to(LocalizationExtImpl).inSingletonScope();
bind(LocalizationExtImpl).toSelf().inSingletonScope();
bind(LocalizationExt).toService(LocalizationExtImpl);
bind(KeyValueStorageProxy).toSelf().inSingletonScope();
bind(InternalStorageExt).toService(KeyValueStorageProxy);
bind(SecretsExtImpl).toSelf().inSingletonScope();
bind(InternalSecretsExt).toService(SecretsExtImpl);
bind(PreferenceRegistryExtImpl).toSelf().inSingletonScope();
bind(DebugExtImpl).toDynamicValue(({ container }) => createDebugExtStub(container))
.inSingletonScope();
bind(DebugExtImpl).toSelf().inSingletonScope();
bind(EditorsAndDocumentsExtImpl).toSelf().inSingletonScope();
bind(WorkspaceExtImpl).toSelf().inSingletonScope();
bind(MessageRegistryExt).toSelf().inSingletonScope();
bind(ClipboardExt).toSelf().inSingletonScope();
bind(WebviewsExtImpl).toSelf().inSingletonScope();
bind(TerminalServiceExtImpl).toSelf().inSingletonScope();
bind(MinimalTerminalServiceExt).toService(TerminalServiceExtImpl);
});
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/plugin/plugin-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ActivatedPlugin {

export const MinimalTerminalServiceExt = Symbol('MinimalTerminalServiceExt');
export type MinimalTerminalServiceExt = Pick<TerminalServiceExt,
'getEnvironmentVariableCollection'|'$initEnvironmentVariableCollections'|'$setShell'>;
'getEnvironmentVariableCollection' | '$initEnvironmentVariableCollections' | '$setShell'>;

@injectable()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit d3e52f7

Please sign in to comment.