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

fix: regressions from headless plugins refactoring #13337

Merged
merged 1 commit into from
Feb 1, 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 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
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,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';
Expand Down Expand Up @@ -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);
});
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
Loading