Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Do not localize plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <[email protected]>
  • Loading branch information
RomanNikitenko committed Sep 23, 2021
1 parent 69c6a40 commit bbca9b4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**********************************************************************
* Copyright (c) 2021 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
***********************************************************************/

import { DeployedPlugin } from '@theia/plugin-ext/lib/common/plugin-protocol';
import { HostedPluginServerImpl } from '@theia/plugin-ext/lib/hosted/node/plugin-service';
import { injectable } from '@theia/core/shared/inversify';

@injectable()
export class CheHostedPluginServerImpl extends HostedPluginServerImpl {
protected async localizePlugin(plugin: DeployedPlugin, locale: string): Promise<DeployedPlugin> {
// che-theia doesn't support localization for plugins
return plugin;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
import * as path from 'path';

import { ContainerModule, interfaces } from 'inversify';
import {
HostedPluginClient,
HostedPluginServer,
hostedServicePath,
} from '@theia/plugin-ext/lib/common/plugin-protocol';
import {
HostedPluginProcess,
HostedPluginProcessConfiguration,
} from '@theia/plugin-ext/lib/hosted/node/hosted-plugin-process';

import { CheHostedPluginServerImpl } from './hosted-plugin-service';
import { ChePluginUriFactory } from './che-plugin-uri-factory';
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
import { HostedPluginMapping } from './plugin-remote-mapping';
Expand All @@ -27,7 +33,7 @@ import { PluginUriFactory } from '@theia/plugin-ext/lib/hosted/node/scanners/plu
import { ServerPluginProxyRunner } from './server-plugin-proxy-runner';
import { ServerPluginRunner } from '@theia/plugin-ext/lib/common';

const localModule = ConnectionContainerModule.create(({ bind, unbind, isBound, rebind }) => {
const localModule = ConnectionContainerModule.create(({ bind, unbind, isBound, rebind, bindBackendService }) => {
bind(HostedPluginRemote)
.toSelf()
.inSingletonScope()
Expand All @@ -39,6 +45,18 @@ const localModule = ConnectionContainerModule.create(({ bind, unbind, isBound, r
bind(ServerPluginRunner).to(ServerPluginProxyRunner).inSingletonScope();
bind(LogHostedPluginProcess).toSelf().inSingletonScope();
rebind(HostedPluginProcess).toService(LogHostedPluginProcess);

bind(CheHostedPluginServerImpl).toSelf().inSingletonScope();
rebind(HostedPluginServer).toService(CheHostedPluginServerImpl);
bindBackendService<HostedPluginServer, HostedPluginClient>(
hostedServicePath,
HostedPluginServer,
(server, client) => {
server.setClient(client);
client.onDidCloseConnection(() => server.dispose());
return server;
}
);
});

export default new ContainerModule((bind, unbind, isBound, rebind) => {
Expand Down

0 comments on commit bbca9b4

Please sign in to comment.