Skip to content

Commit

Permalink
Fix work extensions with no activation function.
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
  • Loading branch information
AndrienkoAleksandr committed Apr 18, 2019
1 parent 1c86bff commit 19ffb9d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 1 addition & 3 deletions packages/plugin-ext/src/hosted/browser/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ export class HostedPluginSupport {
for (const plugin of pluginsMetadata) {
if (plugin.model.entryPoint.frontend) {
result[0] = true;
}

if (plugin.model.entryPoint.backend) {
} else {
result[1] = true;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/hosted/node/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class HostedPluginSupport {
}

runPlugin(plugin: PluginModel): void {
if (plugin.entryPoint.backend) {
if (!plugin.entryPoint.frontend) {
this.runPluginServer();
}
}
Expand Down
18 changes: 9 additions & 9 deletions packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ export class PluginHostRPC {
for (const plg of raw) {
const pluginModel = plg.model;
const pluginLifecycle = plg.lifecycle;
if (pluginModel.entryPoint!.backend) {

if (pluginModel.entryPoint!.frontend) {
foreign.push({
pluginPath: pluginModel.entryPoint.frontend!,
pluginFolder: plg.source.packagePath,
model: pluginModel,
lifecycle: pluginLifecycle,
rawModel: plg.source
});
} else {
let backendInitPath = pluginLifecycle.backendInitPath;
// if no init path, try to init as regular Theia plugin
if (!backendInitPath) {
Expand All @@ -152,14 +160,6 @@ export class PluginHostRPC {
self.initContext(backendInitPath, plugin);

result.push(plugin);
} else {
foreign.push({
pluginPath: pluginModel.entryPoint.frontend!,
pluginFolder: plg.source.packagePath,
model: pluginModel,
lifecycle: pluginLifecycle,
rawModel: plg.source
});
}
}
return [result, foreign];
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-ext/src/plugin/plugin-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {

// run plugins
for (const plugin of plugins) {
if (!plugin.pluginPath) {
continue;
}
const pluginMain = this.host.loadPlugin(plugin);
// able to load the plug-in ?
if (pluginMain !== undefined) {
Expand Down

0 comments on commit 19ffb9d

Please sign in to comment.