diff --git a/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts b/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts index c2016725f7aa0..64e35536a529c 100644 --- a/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts +++ b/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts @@ -240,6 +240,7 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport this.load()); this.server.onDidOpenConnection(() => this.load()); } diff --git a/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts b/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts index f24f83223e6d2..56045b5f839fe 100644 --- a/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts +++ b/packages/plugin-ext/src/hosted/browser/worker/worker-main.ts @@ -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'; @@ -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 diff --git a/packages/plugin-ext/src/hosted/browser/worker/worker-plugin-module.ts b/packages/plugin-ext/src/hosted/browser/worker/worker-plugin-module.ts index ebace3685d069..155575aaff93a 100644 --- a/packages/plugin-ext/src/hosted/browser/worker/worker-plugin-module.ts +++ b/packages/plugin-ext/src/hosted/browser/worker/worker-plugin-module.ts @@ -23,10 +23,10 @@ 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'; @@ -58,16 +58,23 @@ 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).toDynamicValue(({ container }) => { + const child = container.createChild(); + child.bind(DebugExtImpl).toSelf(); + return createDebugExtStub(child); + }).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); }); diff --git a/packages/plugin-ext/src/plugin/plugin-manager.ts b/packages/plugin-ext/src/plugin/plugin-manager.ts index bffd73d1de30a..c9ea874c98537 100644 --- a/packages/plugin-ext/src/plugin/plugin-manager.ts +++ b/packages/plugin-ext/src/plugin/plugin-manager.ts @@ -81,7 +81,7 @@ class ActivatedPlugin { export const MinimalTerminalServiceExt = Symbol('MinimalTerminalServiceExt'); export type MinimalTerminalServiceExt = Pick; + 'getEnvironmentVariableCollection' | '$initEnvironmentVariableCollections' | '$setShell'>; @injectable() // eslint-disable-next-line @typescript-eslint/no-explicit-any