Skip to content

Commit

Permalink
Rename HostedPluginServer, etc. (#10352)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <tmader@redhat.com>
  • Loading branch information
tsmaeder authored Nov 23, 2021
1 parent 10c38b4 commit 6b9e099
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Change Log

- [plugindev] Renamed HostedPlugin(Server|Client) to PluginDev(Server|Client)
## v1.19.0 - 10/28/2021

[1.19.0 Milestone](https://github.com/eclipse-theia/theia/milestone/25)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/common/messaging/proxy-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class JsonRpcProxyFactory<T extends object> implements ProxyHandler<T> {
try {
if (isNotify) {
connection.sendNotification(method, ...args);
resolve();
resolve(undefined);
} else {
const resultPromise = connection.sendRequest(method, ...args) as Promise<any>;
resultPromise
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-dev/src/browser/hosted-plugin-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { CommandRegistry } from '@theia/core/shared/@phosphor/commands';
import { Menu } from '@theia/core/shared/@phosphor/widgets';
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
import { ConnectionStatusService, ConnectionStatus } from '@theia/core/lib/browser/connection-status-service';
import { HostedPluginServer } from '../common/plugin-dev-protocol';
import { PluginDevServer } from '../common/plugin-dev-protocol';
import { HostedPluginManagerClient, HostedInstanceState, HostedPluginCommands, HostedInstanceData } from './hosted-plugin-manager-client';
import { HostedPluginLogViewer } from './hosted-plugin-log-viewer';
import { HostedPluginPreferences } from './hosted-plugin-preferences';
Expand All @@ -45,8 +45,8 @@ export class HostedPluginController implements FrontendApplicationContribution {
@inject(FrontendApplicationStateService)
protected readonly frontendApplicationStateService: FrontendApplicationStateService;

@inject(HostedPluginServer)
protected readonly hostedPluginServer: HostedPluginServer;
@inject(PluginDevServer)
protected readonly hostedPluginServer: PluginDevServer;

@inject(HostedPluginManagerClient)
protected readonly hostedPluginManagerClient: HostedPluginManagerClient;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-dev/src/browser/hosted-plugin-informer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { injectable, inject } from '@theia/core/shared/inversify';
import { StatusBar } from '@theia/core/lib/browser/status-bar/status-bar';
import { StatusBarAlignment, StatusBarEntry, FrontendApplicationContribution } from '@theia/core/lib/browser';
import { WorkspaceService } from '@theia/workspace/lib/browser';
import { HostedPluginServer } from '../common/plugin-dev-protocol';
import { PluginDevServer } from '../common/plugin-dev-protocol';
import { ConnectionStatusService, ConnectionStatus } from '@theia/core/lib/browser/connection-status-service';
import { FileStat } from '@theia/filesystem/lib/common/files';
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
Expand All @@ -45,8 +45,8 @@ export class HostedPluginInformer implements FrontendApplicationContribution {
@inject(WorkspaceService)
protected readonly workspaceService: WorkspaceService;

@inject(HostedPluginServer)
protected readonly hostedPluginServer: HostedPluginServer;
@inject(PluginDevServer)
protected readonly hostedPluginServer: PluginDevServer;

@inject(ConnectionStatusService)
protected readonly connectionStatusService: ConnectionStatusService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { LabelProvider, isNative, AbstractDialog } from '@theia/core/lib/browser
import { WindowService } from '@theia/core/lib/browser/window/window-service';
import { WorkspaceService } from '@theia/workspace/lib/browser';
import { FileDialogService } from '@theia/filesystem/lib/browser';
import { HostedPluginServer } from '../common/plugin-dev-protocol';
import { PluginDevServer } from '../common/plugin-dev-protocol';
import { DebugPluginConfiguration, LaunchVSCodeArgument, LaunchVSCodeRequest, LaunchVSCodeResult } from '@theia/debug/lib/browser/debug-contribution';
import { DebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager';
import { HostedPluginPreferences } from './hosted-plugin-preferences';
Expand Down Expand Up @@ -107,8 +107,8 @@ export class HostedPluginManagerClient {
return this.stateChanged.event;
}

@inject(HostedPluginServer)
protected readonly hostedPluginServer: HostedPluginServer;
@inject(PluginDevServer)
protected readonly hostedPluginServer: PluginDevServer;
@inject(MessageService)
protected readonly messageService: MessageService;
@inject(LabelProvider)
Expand Down
8 changes: 3 additions & 5 deletions packages/plugin-dev/src/browser/plugin-dev-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
import { FrontendApplicationContribution, WebSocketConnectionProvider } from '@theia/core/lib/browser';
import { HostedPluginFrontendContribution } from './hosted-plugin-frontend-contribution';
import { CommandContribution } from '@theia/core/lib/common/command';
import { HostedPluginServer, hostedServicePath } from '../common/plugin-dev-protocol';
import { HostedPluginWatcher } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin-watcher';
import { PluginDevServer, pluginDevServicePath } from '../common/plugin-dev-protocol';
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';

export default new ContainerModule((bind, unbind, isBound, rebind) => {
Expand All @@ -39,9 +38,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(HostedPluginFrontendContribution).toSelf().inSingletonScope();
bind(CommandContribution).toService(HostedPluginFrontendContribution);

bind(HostedPluginServer).toDynamicValue(ctx => {
bind(PluginDevServer).toDynamicValue(ctx => {
const connection = ctx.container.get(WebSocketConnectionProvider);
const hostedWatcher = ctx.container.get(HostedPluginWatcher);
return connection.createProxy<HostedPluginServer>(hostedServicePath, hostedWatcher.getHostedPluginClient());
return connection.createProxy<PluginDevServer>(pluginDevServicePath);
}).inSingletonScope();
});
8 changes: 4 additions & 4 deletions packages/plugin-dev/src/common/plugin-dev-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { JsonRpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
import { DebugPluginConfiguration } from '@theia/debug/lib/browser/debug-contribution';
import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';

export const hostedServicePath = '/services/plugin-dev';
export const HostedPluginServer = Symbol('HostedPluginServer');
export interface HostedPluginServer extends JsonRpcServer<HostedPluginClient> {
export const pluginDevServicePath = '/services/plugin-dev';
export const PluginDevServer = Symbol('PluginDevServer');
export interface PluginDevServer extends JsonRpcServer<PluginDevClient> {
getHostedPlugin(): Promise<PluginMetadata | undefined>;
runHostedPluginInstance(uri: string): Promise<string>;
runDebugHostedPluginInstance(uri: string, debugConfig: DebugPluginConfiguration): Promise<string>;
Expand All @@ -37,5 +37,5 @@ export interface HostedPluginServer extends JsonRpcServer<HostedPluginClient> {
isPluginValid(uri: string): Promise<boolean>;
}

export interface HostedPluginClient {
export interface PluginDevClient {
}
10 changes: 5 additions & 5 deletions packages/plugin-dev/src/node/plugin-dev-backend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ import { HostedPluginsManager, HostedPluginsManagerImpl } from './hosted-plugins
import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
import { bindContributionProvider } from '@theia/core/lib/common/contribution-provider';
import { HostedPluginServerImpl } from './hosted-plugin-service';
import { HostedPluginServer, HostedPluginClient, hostedServicePath } from '../common/plugin-dev-protocol';
import { PluginDevServerImpl } from './plugin-dev-service';
import { PluginDevServer, PluginDevClient, pluginDevServicePath } from '../common/plugin-dev-protocol';
import { HostedPluginReader } from './hosted-plugin-reader';
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';

const commonHostedConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
bind(HostedPluginsManagerImpl).toSelf().inSingletonScope();
bind(HostedPluginsManager).toService(HostedPluginsManagerImpl);
bind(HostedPluginServerImpl).toSelf().inSingletonScope();
bind(HostedPluginServer).toService(HostedPluginServerImpl);
bindBackendService<HostedPluginServer, HostedPluginClient>(hostedServicePath, HostedPluginServer, (server, client) => {
bind(PluginDevServerImpl).toSelf().inSingletonScope();
bind(PluginDevServer).toService(PluginDevServerImpl);
bindBackendService<PluginDevServer, PluginDevClient>(pluginDevServicePath, PluginDevServer, (server, client) => {
server.setClient(client);
client.onDidCloseConnection(() => server.dispose());
return server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { HostedPluginServer, HostedPluginClient } from '../common/plugin-dev-protocol';
import { PluginDevServer, PluginDevClient } from '../common/plugin-dev-protocol';
import { injectable, inject } from '@theia/core/shared/inversify';
import { HostedInstanceManager } from './hosted-instance-manager';
import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
Expand All @@ -26,7 +26,7 @@ import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-pl
import { DebugPluginConfiguration } from '@theia/debug/lib/browser/debug-contribution';

@injectable()
export class HostedPluginServerImpl implements HostedPluginServer {
export class PluginDevServerImpl implements PluginDevServer {

@inject(HostedPluginsManager)
protected readonly hostedPluginsManager: HostedPluginsManager;
Expand All @@ -46,7 +46,7 @@ export class HostedPluginServerImpl implements HostedPluginServer {
this.hostedInstanceManager.terminate();
}
}
setClient(client: HostedPluginClient): void {
setClient(client: PluginDevClient): void {

}

Expand Down

0 comments on commit 6b9e099

Please sign in to comment.