-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
@@ -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) => { |
There was a problem hiding this comment.
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[]] { |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 :-)
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
are you gonna remove the merge commit (use rebase instead ? ) |
Yes, I wait approve before squashing commits |
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
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