@theia/plugin-dev 1.18.0-next.de7b81be → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +642 -0
- package/lib/browser/hosted-plugin-controller.d.ts +2 -2
- package/lib/browser/hosted-plugin-controller.d.ts.map +1 -1
- package/lib/browser/hosted-plugin-controller.js +12 -11
- package/lib/browser/hosted-plugin-controller.js.map +1 -1
- package/lib/browser/hosted-plugin-informer.d.ts +2 -2
- package/lib/browser/hosted-plugin-informer.d.ts.map +1 -1
- package/lib/browser/hosted-plugin-informer.js +3 -2
- package/lib/browser/hosted-plugin-informer.js.map +1 -1
- package/lib/browser/hosted-plugin-log-viewer.d.ts +1 -1
- package/lib/browser/hosted-plugin-log-viewer.d.ts.map +1 -1
- package/lib/browser/hosted-plugin-log-viewer.js +1 -1
- package/lib/browser/hosted-plugin-log-viewer.js.map +1 -1
- package/lib/browser/hosted-plugin-manager-client.d.ts +2 -2
- package/lib/browser/hosted-plugin-manager-client.d.ts.map +1 -1
- package/lib/browser/hosted-plugin-manager-client.js +31 -27
- package/lib/browser/hosted-plugin-manager-client.js.map +1 -1
- package/lib/browser/hosted-plugin-preferences.d.ts.map +1 -1
- package/lib/browser/hosted-plugin-preferences.js +4 -3
- package/lib/browser/hosted-plugin-preferences.js.map +1 -1
- package/lib/browser/plugin-dev-frontend-module.d.ts.map +1 -1
- package/lib/browser/plugin-dev-frontend-module.js +2 -4
- package/lib/browser/plugin-dev-frontend-module.js.map +1 -1
- package/lib/common/plugin-dev-protocol.d.ts +4 -4
- package/lib/common/plugin-dev-protocol.d.ts.map +1 -1
- package/lib/common/plugin-dev-protocol.js +3 -3
- package/lib/common/plugin-dev-protocol.js.map +1 -1
- package/lib/node/hosted-instance-manager.d.ts.map +1 -1
- package/lib/node/hosted-instance-manager.js.map +1 -1
- package/lib/node/plugin-dev-backend-module.js +4 -4
- package/lib/node/plugin-dev-backend-module.js.map +1 -1
- package/lib/node/{hosted-plugin-service.d.ts → plugin-dev-service.d.ts} +4 -4
- package/lib/node/plugin-dev-service.d.ts.map +1 -0
- package/lib/node/{hosted-plugin-service.js → plugin-dev-service.js} +10 -10
- package/lib/node/plugin-dev-service.js.map +1 -0
- package/package.json +15 -13
- package/src/browser/hosted-plugin-controller.ts +14 -13
- package/src/browser/hosted-plugin-informer.ts +5 -4
- package/src/browser/hosted-plugin-log-viewer.ts +1 -1
- package/src/browser/hosted-plugin-manager-client.ts +35 -29
- package/src/browser/hosted-plugin-preferences.ts +7 -3
- package/src/browser/plugin-dev-frontend-module.ts +3 -5
- package/src/common/plugin-dev-protocol.ts +5 -4
- package/src/node/hosted-instance-manager.ts +1 -0
- package/src/node/plugin-dev-backend-module.ts +5 -5
- package/src/node/{hosted-plugin-service.ts → plugin-dev-service.ts} +4 -3
- package/lib/node/hosted-plugin-service.d.ts.map +0 -1
- package/lib/node/hosted-plugin-service.js.map +0 -1
|
@@ -22,46 +22,50 @@ import { LabelProvider, isNative, AbstractDialog } from '@theia/core/lib/browser
|
|
|
22
22
|
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
23
23
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
24
24
|
import { FileDialogService } from '@theia/filesystem/lib/browser';
|
|
25
|
-
import {
|
|
25
|
+
import { PluginDevServer } from '../common/plugin-dev-protocol';
|
|
26
26
|
import { DebugPluginConfiguration, LaunchVSCodeArgument, LaunchVSCodeRequest, LaunchVSCodeResult } from '@theia/debug/lib/browser/debug-contribution';
|
|
27
27
|
import { DebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager';
|
|
28
28
|
import { HostedPluginPreferences } from './hosted-plugin-preferences';
|
|
29
29
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
30
30
|
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
31
31
|
import { DebugSessionConnection } from '@theia/debug/lib/browser/debug-session-connection';
|
|
32
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Commands to control Hosted plugin instances.
|
|
35
36
|
*/
|
|
36
37
|
export namespace HostedPluginCommands {
|
|
38
|
+
const HOSTED_PLUGIN_CATEGORY_KEY = 'theia/plugin-dev/hostedPlugin';
|
|
37
39
|
const HOSTED_PLUGIN_CATEGORY = 'Hosted Plugin';
|
|
38
|
-
export const START
|
|
40
|
+
export const START = Command.toLocalizedCommand({
|
|
39
41
|
id: 'hosted-plugin:start',
|
|
40
42
|
category: HOSTED_PLUGIN_CATEGORY,
|
|
41
43
|
label: 'Start Instance'
|
|
42
|
-
};
|
|
44
|
+
}, 'theia/plugin-dev/startInstance', HOSTED_PLUGIN_CATEGORY_KEY);
|
|
43
45
|
|
|
44
|
-
export const DEBUG
|
|
46
|
+
export const DEBUG = Command.toLocalizedCommand({
|
|
45
47
|
id: 'hosted-plugin:debug',
|
|
46
48
|
category: HOSTED_PLUGIN_CATEGORY,
|
|
47
49
|
label: 'Debug Instance'
|
|
48
|
-
};
|
|
50
|
+
}, 'theia/plugin-dev/debugInstance', HOSTED_PLUGIN_CATEGORY_KEY);
|
|
49
51
|
|
|
50
|
-
export const STOP
|
|
52
|
+
export const STOP = Command.toLocalizedCommand({
|
|
51
53
|
id: 'hosted-plugin:stop',
|
|
52
54
|
category: HOSTED_PLUGIN_CATEGORY,
|
|
53
55
|
label: 'Stop Instance'
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
+
}, 'theia/plugin-dev/stopInstance', HOSTED_PLUGIN_CATEGORY_KEY);
|
|
57
|
+
|
|
58
|
+
export const RESTART = Command.toLocalizedCommand({
|
|
56
59
|
id: 'hosted-plugin:restart',
|
|
57
60
|
category: HOSTED_PLUGIN_CATEGORY,
|
|
58
61
|
label: 'Restart Instance'
|
|
59
|
-
};
|
|
60
|
-
|
|
62
|
+
}, 'theia/plugin-dev/restartInstance', HOSTED_PLUGIN_CATEGORY_KEY);
|
|
63
|
+
|
|
64
|
+
export const SELECT_PATH = Command.toLocalizedCommand({
|
|
61
65
|
id: 'hosted-plugin:select-path',
|
|
62
66
|
category: HOSTED_PLUGIN_CATEGORY,
|
|
63
67
|
label: 'Select Path'
|
|
64
|
-
};
|
|
68
|
+
}, 'theia/plugin-dev/selectPath', HOSTED_PLUGIN_CATEGORY_KEY);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
/**
|
|
@@ -103,8 +107,8 @@ export class HostedPluginManagerClient {
|
|
|
103
107
|
return this.stateChanged.event;
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
@inject(
|
|
107
|
-
protected readonly hostedPluginServer:
|
|
110
|
+
@inject(PluginDevServer)
|
|
111
|
+
protected readonly hostedPluginServer: PluginDevServer;
|
|
108
112
|
@inject(MessageService)
|
|
109
113
|
protected readonly messageService: MessageService;
|
|
110
114
|
@inject(LabelProvider)
|
|
@@ -143,7 +147,7 @@ export class HostedPluginManagerClient {
|
|
|
143
147
|
|
|
144
148
|
async start(debugConfig?: DebugPluginConfiguration): Promise<void> {
|
|
145
149
|
if (await this.hostedPluginServer.isHostedPluginInstanceRunning()) {
|
|
146
|
-
this.messageService.warn('Hosted instance is already running.');
|
|
150
|
+
this.messageService.warn(nls.localize('theia/plugin-dev/alreadyRunning', 'Hosted instance is already running.'));
|
|
147
151
|
return;
|
|
148
152
|
}
|
|
149
153
|
|
|
@@ -157,7 +161,7 @@ export class HostedPluginManagerClient {
|
|
|
157
161
|
|
|
158
162
|
try {
|
|
159
163
|
this.stateChanged.fire({ state: HostedInstanceState.STARTING, pluginLocation: this.pluginLocation });
|
|
160
|
-
this.messageService.info('Starting hosted instance server ...');
|
|
164
|
+
this.messageService.info(nls.localize('theia/plugin-dev/starting', 'Starting hosted instance server ...'));
|
|
161
165
|
|
|
162
166
|
if (debugConfig) {
|
|
163
167
|
this.isDebug = true;
|
|
@@ -168,10 +172,10 @@ export class HostedPluginManagerClient {
|
|
|
168
172
|
}
|
|
169
173
|
await this.openPluginWindow();
|
|
170
174
|
|
|
171
|
-
this.messageService.info('Hosted instance is running at:
|
|
175
|
+
this.messageService.info(`${nls.localize('theia/plugin-dev/running', 'Hosted instance is running at:')} ${this.pluginInstanceURL}`);
|
|
172
176
|
this.stateChanged.fire({ state: HostedInstanceState.RUNNING, pluginLocation: this.pluginLocation });
|
|
173
177
|
} catch (error) {
|
|
174
|
-
this.messageService.error('Failed to run hosted plugin instance: '
|
|
178
|
+
this.messageService.error(nls.localize('theia/plugin-dev/failed', 'Failed to run hosted plugin instance: {0}', this.getErrorMessage(error)));
|
|
175
179
|
this.stateChanged.fire({ state: HostedInstanceState.FAILED, pluginLocation: this.pluginLocation });
|
|
176
180
|
this.stop();
|
|
177
181
|
}
|
|
@@ -199,7 +203,7 @@ export class HostedPluginManagerClient {
|
|
|
199
203
|
type: 'node',
|
|
200
204
|
request: 'attach',
|
|
201
205
|
timeout: 30000,
|
|
202
|
-
name: 'Hosted Plugin',
|
|
206
|
+
name: nls.localize('theia/plugin-dev/hostedPlugin', 'Hosted Plugin'),
|
|
203
207
|
smartStep: true,
|
|
204
208
|
sourceMaps: !!outFiles,
|
|
205
209
|
outFiles
|
|
@@ -209,13 +213,15 @@ export class HostedPluginManagerClient {
|
|
|
209
213
|
|
|
210
214
|
async stop(checkRunning: boolean = true): Promise<void> {
|
|
211
215
|
if (checkRunning && !await this.hostedPluginServer.isHostedPluginInstanceRunning()) {
|
|
212
|
-
this.messageService.warn('Hosted instance is not running.');
|
|
216
|
+
this.messageService.warn(nls.localize('theia/plugin-dev/notRunning', 'Hosted instance is not running.'));
|
|
213
217
|
return;
|
|
214
218
|
}
|
|
215
219
|
try {
|
|
216
220
|
this.stateChanged.fire({ state: HostedInstanceState.STOPPING, pluginLocation: this.pluginLocation! });
|
|
217
221
|
await this.hostedPluginServer.terminateHostedPluginInstance();
|
|
218
|
-
this.messageService.info((this.pluginInstanceURL
|
|
222
|
+
this.messageService.info((this.pluginInstanceURL
|
|
223
|
+
? nls.localize('theia/plugin-dev/instanceTerminated', '{0} has been terminated', this.pluginInstanceURL)
|
|
224
|
+
: nls.localize('theia/plugin-dev/unknownTerminated', 'The instance has been terminated')));
|
|
219
225
|
this.stateChanged.fire({ state: HostedInstanceState.STOPPED, pluginLocation: this.pluginLocation! });
|
|
220
226
|
} catch (error) {
|
|
221
227
|
this.messageService.error(this.getErrorMessage(error));
|
|
@@ -226,7 +232,7 @@ export class HostedPluginManagerClient {
|
|
|
226
232
|
if (await this.hostedPluginServer.isHostedPluginInstanceRunning()) {
|
|
227
233
|
await this.stop(false);
|
|
228
234
|
|
|
229
|
-
this.messageService.info('Starting hosted instance server ...');
|
|
235
|
+
this.messageService.info(nls.localize('theia/plugin-dev/starting', 'Starting hosted instance server ...'));
|
|
230
236
|
|
|
231
237
|
// It takes some time before OS released all resources e.g. port.
|
|
232
238
|
// Keep trying to run hosted instance with delay.
|
|
@@ -243,7 +249,7 @@ export class HostedPluginManagerClient {
|
|
|
243
249
|
this.pluginInstanceURL = await this.hostedPluginServer.runHostedPluginInstance(this.pluginLocation!.toString());
|
|
244
250
|
}
|
|
245
251
|
await this.openPluginWindow();
|
|
246
|
-
this.messageService.info('Hosted instance is running at:
|
|
252
|
+
this.messageService.info(`${nls.localize('theia/plugin-dev/running', 'Hosted instance is running at:')} ${this.pluginInstanceURL}`);
|
|
247
253
|
this.stateChanged.fire({
|
|
248
254
|
state: HostedInstanceState.RUNNING,
|
|
249
255
|
pluginLocation: this.pluginLocation!
|
|
@@ -254,11 +260,11 @@ export class HostedPluginManagerClient {
|
|
|
254
260
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
255
261
|
}
|
|
256
262
|
}
|
|
257
|
-
this.messageService.error('Failed to run hosted plugin instance: '
|
|
263
|
+
this.messageService.error(nls.localize('theia/plugin-dev/failed', 'Failed to run hosted plugin instance: {0}', this.getErrorMessage(lastError)));
|
|
258
264
|
this.stateChanged.fire({ state: HostedInstanceState.FAILED, pluginLocation: this.pluginLocation! });
|
|
259
265
|
this.stop();
|
|
260
266
|
} else {
|
|
261
|
-
this.messageService.warn('Hosted
|
|
267
|
+
this.messageService.warn(nls.localize('theia/plugin-dev/notRunning', 'Hosted instance is not running.'));
|
|
262
268
|
this.start();
|
|
263
269
|
}
|
|
264
270
|
}
|
|
@@ -274,7 +280,7 @@ export class HostedPluginManagerClient {
|
|
|
274
280
|
|
|
275
281
|
const result = await this.fileDialogService.showOpenDialog({
|
|
276
282
|
title: HostedPluginCommands.SELECT_PATH.label!,
|
|
277
|
-
openLabel: 'Select',
|
|
283
|
+
openLabel: nls.localize('theia/plugin-dev/select', 'Select'),
|
|
278
284
|
canSelectFiles: false,
|
|
279
285
|
canSelectFolders: true,
|
|
280
286
|
canSelectMany: false
|
|
@@ -283,9 +289,9 @@ export class HostedPluginManagerClient {
|
|
|
283
289
|
if (result) {
|
|
284
290
|
if (await this.hostedPluginServer.isPluginValid(result.toString())) {
|
|
285
291
|
this.pluginLocation = result;
|
|
286
|
-
this.messageService.info('Plugin folder is set to: '
|
|
292
|
+
this.messageService.info(nls.localize('theia/plugin-dev/pluginFolder', 'Plugin folder is set to: {0}', this.labelProvider.getLongName(result)));
|
|
287
293
|
} else {
|
|
288
|
-
this.messageService.error('Specified folder does not contain valid plugin.');
|
|
294
|
+
this.messageService.error(nls.localize('theia/plugin-dev/noValidPlugin', 'Specified folder does not contain valid plugin.'));
|
|
289
295
|
}
|
|
290
296
|
}
|
|
291
297
|
}
|
|
@@ -386,7 +392,7 @@ class OpenHostedInstanceLinkDialog extends AbstractDialog<string> {
|
|
|
386
392
|
|
|
387
393
|
constructor(windowService: WindowService) {
|
|
388
394
|
super({
|
|
389
|
-
title: 'Your browser prevented opening of a new tab'
|
|
395
|
+
title: nls.localize('theia/plugin-dev/preventedNewTab', 'Your browser prevented opening of a new tab')
|
|
390
396
|
});
|
|
391
397
|
this.windowService = windowService;
|
|
392
398
|
|
|
@@ -396,7 +402,7 @@ class OpenHostedInstanceLinkDialog extends AbstractDialog<string> {
|
|
|
396
402
|
this.contentNode.appendChild(this.linkNode);
|
|
397
403
|
|
|
398
404
|
const messageNode = document.createElement('div');
|
|
399
|
-
messageNode.innerText = 'Hosted instance is
|
|
405
|
+
messageNode.innerText = nls.localize('theia/plugin-dev/running', 'Hosted instance is running at:') + ' ';
|
|
400
406
|
messageNode.appendChild(this.linkNode);
|
|
401
407
|
this.contentNode.appendChild(messageNode);
|
|
402
408
|
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
|
|
17
17
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
18
18
|
import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceContribution, PreferenceSchema } from '@theia/core/lib/browser';
|
|
19
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
19
20
|
|
|
20
21
|
export const HostedPluginConfigSchema: PreferenceSchema = {
|
|
21
22
|
'type': 'object',
|
|
22
23
|
properties: {
|
|
23
24
|
'hosted-plugin.watchMode': {
|
|
24
25
|
type: 'boolean',
|
|
25
|
-
description: 'Run watcher on plugin under development',
|
|
26
|
+
description: nls.localize('theia/plugin-dev/watchMode', 'Run watcher on plugin under development'),
|
|
26
27
|
default: true
|
|
27
28
|
},
|
|
28
29
|
'hosted-plugin.debugMode': {
|
|
29
30
|
type: 'string',
|
|
30
|
-
description: 'Using inspect or inspect-brk for Node.js debug',
|
|
31
|
+
description: nls.localize('theia/plugin-dev/debugMode', 'Using inspect or inspect-brk for Node.js debug'),
|
|
31
32
|
default: 'inspect',
|
|
32
33
|
enum: ['inspect', 'inspect-brk']
|
|
33
34
|
},
|
|
@@ -36,7 +37,10 @@ export const HostedPluginConfigSchema: PreferenceSchema = {
|
|
|
36
37
|
items: {
|
|
37
38
|
type: 'string'
|
|
38
39
|
},
|
|
39
|
-
description:
|
|
40
|
+
description: nls.localize(
|
|
41
|
+
'theia/plugin-dev/launchOutFiles',
|
|
42
|
+
'Array of glob patterns for locating generated JavaScript files (`${pluginPath}` will be replaced by plugin actual path).'
|
|
43
|
+
),
|
|
40
44
|
default: ['${pluginPath}/out/**/*.js']
|
|
41
45
|
}
|
|
42
46
|
}
|
|
@@ -23,8 +23,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
|
|
|
23
23
|
import { FrontendApplicationContribution, WebSocketConnectionProvider } from '@theia/core/lib/browser';
|
|
24
24
|
import { HostedPluginFrontendContribution } from './hosted-plugin-frontend-contribution';
|
|
25
25
|
import { CommandContribution } from '@theia/core/lib/common/command';
|
|
26
|
-
import {
|
|
27
|
-
import { HostedPluginWatcher } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin-watcher';
|
|
26
|
+
import { PluginDevServer, pluginDevServicePath } from '../common/plugin-dev-protocol';
|
|
28
27
|
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
29
28
|
|
|
30
29
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
@@ -39,9 +38,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
39
38
|
bind(HostedPluginFrontendContribution).toSelf().inSingletonScope();
|
|
40
39
|
bind(CommandContribution).toService(HostedPluginFrontendContribution);
|
|
41
40
|
|
|
42
|
-
bind(
|
|
41
|
+
bind(PluginDevServer).toDynamicValue(ctx => {
|
|
43
42
|
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
44
|
-
|
|
45
|
-
return connection.createProxy<HostedPluginServer>(hostedServicePath, hostedWatcher.getHostedPluginClient());
|
|
43
|
+
return connection.createProxy<PluginDevServer>(pluginDevServicePath);
|
|
46
44
|
}).inSingletonScope();
|
|
47
45
|
});
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
17
|
import { JsonRpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
|
|
18
|
+
// eslint-disable-next-line @theia/runtime-import-check
|
|
18
19
|
import { DebugPluginConfiguration } from '@theia/debug/lib/browser/debug-contribution';
|
|
19
20
|
import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
20
21
|
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export interface
|
|
22
|
+
export const pluginDevServicePath = '/services/plugin-dev';
|
|
23
|
+
export const PluginDevServer = Symbol('PluginDevServer');
|
|
24
|
+
export interface PluginDevServer extends JsonRpcServer<PluginDevClient> {
|
|
24
25
|
getHostedPlugin(): Promise<PluginMetadata | undefined>;
|
|
25
26
|
runHostedPluginInstance(uri: string): Promise<string>;
|
|
26
27
|
runDebugHostedPluginInstance(uri: string, debugConfig: DebugPluginConfiguration): Promise<string>;
|
|
@@ -36,5 +37,5 @@ export interface HostedPluginServer extends JsonRpcServer<HostedPluginClient> {
|
|
|
36
37
|
isPluginValid(uri: string): Promise<boolean>;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export interface
|
|
40
|
+
export interface PluginDevClient {
|
|
40
41
|
}
|
|
@@ -29,6 +29,7 @@ import { FileUri } from '@theia/core/lib/node/file-uri';
|
|
|
29
29
|
import { LogType } from '@theia/plugin-ext/lib/common/types';
|
|
30
30
|
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin';
|
|
31
31
|
import { MetadataScanner } from '@theia/plugin-ext/lib/hosted/node/metadata-scanner';
|
|
32
|
+
// eslint-disable-next-line @theia/runtime-import-check
|
|
32
33
|
import { DebugPluginConfiguration } from '@theia/debug/lib/browser/debug-contribution';
|
|
33
34
|
import { HostedPluginProcess } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin-process';
|
|
34
35
|
|
|
@@ -20,17 +20,17 @@ import { HostedPluginsManager, HostedPluginsManagerImpl } from './hosted-plugins
|
|
|
20
20
|
import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
|
|
21
21
|
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
|
|
22
22
|
import { bindContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { PluginDevServerImpl } from './plugin-dev-service';
|
|
24
|
+
import { PluginDevServer, PluginDevClient, pluginDevServicePath } from '../common/plugin-dev-protocol';
|
|
25
25
|
import { HostedPluginReader } from './hosted-plugin-reader';
|
|
26
26
|
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
27
27
|
|
|
28
28
|
const commonHostedConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
|
|
29
29
|
bind(HostedPluginsManagerImpl).toSelf().inSingletonScope();
|
|
30
30
|
bind(HostedPluginsManager).toService(HostedPluginsManagerImpl);
|
|
31
|
-
bind(
|
|
32
|
-
bind(
|
|
33
|
-
bindBackendService<
|
|
31
|
+
bind(PluginDevServerImpl).toSelf().inSingletonScope();
|
|
32
|
+
bind(PluginDevServer).toService(PluginDevServerImpl);
|
|
33
|
+
bindBackendService<PluginDevServer, PluginDevClient>(pluginDevServicePath, PluginDevServer, (server, client) => {
|
|
34
34
|
server.setClient(client);
|
|
35
35
|
client.onDidCloseConnection(() => server.dispose());
|
|
36
36
|
return server;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { PluginDevServer, PluginDevClient } from '../common/plugin-dev-protocol';
|
|
18
18
|
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
19
19
|
import { HostedInstanceManager } from './hosted-instance-manager';
|
|
20
20
|
import { PluginMetadata } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
@@ -22,10 +22,11 @@ import URI from '@theia/core/lib/common/uri';
|
|
|
22
22
|
import { HostedPluginReader } from './hosted-plugin-reader';
|
|
23
23
|
import { HostedPluginsManager } from './hosted-plugins-manager';
|
|
24
24
|
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin';
|
|
25
|
+
// eslint-disable-next-line @theia/runtime-import-check
|
|
25
26
|
import { DebugPluginConfiguration } from '@theia/debug/lib/browser/debug-contribution';
|
|
26
27
|
|
|
27
28
|
@injectable()
|
|
28
|
-
export class
|
|
29
|
+
export class PluginDevServerImpl implements PluginDevServer {
|
|
29
30
|
|
|
30
31
|
@inject(HostedPluginsManager)
|
|
31
32
|
protected readonly hostedPluginsManager: HostedPluginsManager;
|
|
@@ -45,7 +46,7 @@ export class HostedPluginServerImpl implements HostedPluginServer {
|
|
|
45
46
|
this.hostedInstanceManager.terminate();
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
setClient(client:
|
|
49
|
+
setClient(client: PluginDevClient): void {
|
|
49
50
|
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-plugin-service.d.ts","sourceRoot":"","sources":["../../src/node/hosted-plugin-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,qBACa,sBAAuB,YAAW,kBAAkB;IAG7D,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAG9D,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGhE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAG5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD,OAAO,IAAI,IAAI;IAMf,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAIrC,eAAe,IAAI,OAAO,CAAC,c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