Skip to content

Commit

Permalink
#2695 fix review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
  • Loading branch information
evidolob committed Aug 29, 2018
1 parent bc14826 commit fc4f15e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { BackendInitializationFn, createAPI, PluginMetadata } from '@theia/plugin-ext';
import { BackendInitializationFn, createAPI, PluginMetadata, PluginManager } from '@theia/plugin-ext';

export const doInitialization: BackendInitializationFn = (rpc: any, manager: any, pluginMetadata: PluginMetadata) => {
export const doInitialization: BackendInitializationFn = (rpc: any, manager: PluginManager, pluginMetadata: PluginMetadata) => {
const module = require('module');
const vscodeModuleName = 'vscode';
const vscode = createAPI(rpc, manager);
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/api/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface Plugin {
pluginPath: string;
initPath: string;
model: PluginModel;
rowModel: PluginPackage;
rawModel: PluginPackage;
lifecycle: PluginLifecycle;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/common/plugin-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export interface PluginLifecycle {
* The export function of initialization module of backend plugin.
*/
export interface BackendInitializationFn {
(rpc: RPCProtocol, manger: PluginManager, pluginMetadata: PluginMetadata): void;
(rpc: RPCProtocol, manager: PluginManager, pluginMetadata: PluginMetadata): void;
}

export interface BackendLoadingFn {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-ext/src/hosted/browser/worker/worker-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ const pluginManager = new PluginManagerExtImpl({
return ctx[plugin.lifecycle.frontendModuleName];
}
},
init(raw: PluginMetadata[]): [Plugin[], Plugin[]] {
init(rawPluginData: PluginMetadata[]): [Plugin[], Plugin[]] {
const result: Plugin[] = [];
const foreign: Plugin[] = [];
for (const plg of raw) {
for (const plg of rawPluginData) {
const pluginModel = plg.model;
const pluginLifecycle = plg.lifecycle;
if (pluginModel.entryPoint!.frontend) {
Expand All @@ -74,7 +74,7 @@ const pluginManager = new PluginManagerExtImpl({
initPath: frontendInitPath,
model: pluginModel,
lifecycle: pluginLifecycle,
rowModel: plg.source
rawModel: plg.source
};
result.push(plugin);
} else {
Expand All @@ -83,7 +83,7 @@ const pluginManager = new PluginManagerExtImpl({
initPath: pluginLifecycle.backendInitPath!,
model: pluginModel,
lifecycle: pluginLifecycle,
rowModel: plg.source
rawModel: plg.source
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/hosted/node/plugin-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const pluginManager = new PluginManagerExtImpl({
initPath: backendInitPath,
model: pluginModel,
lifecycle: pluginLifecycle,
rowModel: plg.source
rawModel: plg.source
};
result.push(plugin);
} else {
Expand All @@ -88,7 +88,7 @@ const pluginManager = new PluginManagerExtImpl({
initPath: pluginLifecycle.frontendInitPath!,
model: pluginModel,
lifecycle: pluginLifecycle,
rowModel: plg.source
rawModel: plg.source
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { CommandRegistryImpl } from './command-registry';
import { Emitter } from '@theia/core/lib/common/event';
import { CancellationTokenSource } from '@theia/core/lib/common/cancellation';
import { QuickOpenExtImpl } from './quick-open';
import { MAIN_RPC_CONTEXT, Plugin as PPlugin, PluginManager } from '../api/plugin-api';
import { MAIN_RPC_CONTEXT, Plugin as InternalPlugin, PluginManager } from '../api/plugin-api';
import { RPCProtocol } from '../api/rpc-protocol';
import { MessageRegistryExt } from './message-registry';
import { StatusBarMessageRegistryExt } from './status-bar-message-registry';
Expand Down Expand Up @@ -339,10 +339,10 @@ class Plugin<T> implements theia.Plugin<T> {
isActive: boolean;
packageJSON: any;
pluginType: theia.PluginType;
constructor(private readonly pluginManager: PluginManager, plugin: PPlugin) {
constructor(private readonly pluginManager: PluginManager, plugin: InternalPlugin) {
this.id = plugin.model.id;
this.pluginPath = plugin.rowModel.packagePath;
this.packageJSON = plugin.rowModel;
this.pluginPath = plugin.rawModel.packagePath;
this.packageJSON = plugin.rawModel;
this.isActive = true;
this.pluginType = plugin.model.entryPoint.frontend ? 'frontend' : 'backend';
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/plugin/plugin-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ export interface PluginHost {
init(data: PluginMetadata[]): [Plugin[], Plugin[]];
}

interface StopFun {
interface StopFn {
(): void;
}

class ActivatedPlugin {
constructor(public readonly pluginContext: theia.PluginContext,
public readonly exports?: PluginAPI,
public readonly stopFun?: StopFun) {
public readonly stopFun?: StopFn) {
}
}

Expand Down

0 comments on commit fc4f15e

Please sign in to comment.