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

[plug-in] Implement 'plugins' API #2695

Merged
merged 1 commit into from
Aug 30, 2018
Merged

[plug-in] Implement 'plugins' API #2695

merged 1 commit into from
Aug 30, 2018

Conversation

evidolob
Copy link
Contributor

Add namespace for dealing with installed plug-ins. Plug-ins are represented
by an Plugin-interface which enables reflection on them.
Plug-in writers can provide APIs to other plug-ins by returning their API public
API from the start-call.

Issue: #2561

Signed-off-by: Yevhen Vydolob yvydolob@redhat.com

@evidolob evidolob added plug-in system issues related to the plug-in system Team: Che-Editors issues regarding the che-editors team labels Aug 29, 2018
@@ -16,10 +16,10 @@

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

export const doInitialization: BackendInitializationFn = (rpc: any, pluginMetadata: PluginMetadata) => {
export const doInitialization: BackendInitializationFn = (rpc: any, manager: any, pluginMetadata: PluginMetadata) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have type for manager ?

// call stop method
if (pluginData.stopPluginMethod) {
pluginData.stopPluginMethod();
init(raw: PluginMetadata[]): [Plugin[], Plugin[]] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use something more meaningful than raw if we know it's of type pluginMetadata ?

@@ -18,9 +18,8 @@ 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 } from '../api/plugin-api';
import { MAIN_RPC_CONTEXT, Plugin as PPlugin, PluginManager } from '../api/plugin-api';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use another name than PPlugin which might not be clear in the rest of the code

model: PluginModel;
rowModel: PluginPackage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? maybe rawModel?

@@ -360,7 +361,7 @@ export interface PluginLifecycle {
* The export function of initialization module of backend plugin.
*/
export interface BackendInitializationFn {
(rpc: RPCProtocol, pluginMetadata: PluginMetadata): void;
(rpc: RPCProtocol, manger: PluginManager, pluginMetadata: PluginMetadata): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo manger -> manager

init(data: PluginMetadata[]): [Plugin[], Plugin[]];
}

interface StopFun {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't mind let it be StopFn or StopFunc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same :-) let's still have some FUN :-)

evidolob added a commit that referenced this pull request Aug 29, 2018
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
evidolob added a commit that referenced this pull request Aug 29, 2018
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@benoitf
Copy link
Contributor

benoitf commented Aug 29, 2018

are you gonna remove the merge commit (use rebase instead ? )

@evidolob
Copy link
Contributor Author

Yes, I wait approve before squashing commits

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob merged commit 975efc6 into master Aug 30, 2018
@evidolob evidolob deleted the plugins-api branch August 30, 2018 08:54
@evidolob evidolob restored the plugins-api branch August 30, 2018 08:59
@evidolob evidolob deleted the plugins-api branch August 30, 2018 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system Team: Che-Editors issues regarding the che-editors team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants