Skip to content

Commit

Permalink
Refactored langauges-main and outputchannelregistry to use DI
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Pinkney <[email protected]>
  • Loading branch information
JPinkney committed Sep 18, 2019
1 parent df1e55a commit 286944f
Show file tree
Hide file tree
Showing 6 changed files with 384 additions and 246 deletions.
12 changes: 11 additions & 1 deletion packages/plugin-ext/src/common/plugin-api-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* tslint:disable:no-any */

import { createProxyIdentifier, ProxyIdentifier } from './rpc-protocol';
import { createProxyIdentifier, ProxyIdentifier, RPCProtocol } from './rpc-protocol';
import * as theia from '@theia/plugin';
import { PluginLifecycle, PluginModel, PluginMetadata, PluginPackage, IconUrl } from './plugin-protocol';
import { QueryParameters } from './env';
Expand Down Expand Up @@ -1141,6 +1141,16 @@ export interface LanguagesExt {
$resolveRenameLocation(handle: number, resource: UriComponents, position: Position, token: CancellationToken): PromiseLike<RenameLocation | undefined>;
}

export const LanguagesMainFactory = Symbol('LanguagesMainFactory');
export interface LanguagesMainFactory {
(proxy: RPCProtocol): LanguagesMain;
}

export const OutputChannelRegistryFactory = Symbol('OutputChannelRegistryFactory');
export interface OutputChannelRegistryFactory {
(): OutputChannelRegistryMain;
}

export interface LanguagesMain {
$getLanguages(): Promise<string[]>;
$changeLanguage(resource: UriComponents, languageId: string): Promise<void>;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-ext/src/common/rpc-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface MessageConnection {
onMessage: Event<{}>;
}

export const RPCProtocol = Symbol('RPCProtocol');
export interface RPCProtocol {
/**
* Returns a proxy to an object addressable/named in the plugin process or in the main process.
Expand Down
Loading

0 comments on commit 286944f

Please sign in to comment.