@theia/plugin-ext 1.75.0-next.8 → 1.76.0-next.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/lib/common/errors.d.ts +1 -14
- package/lib/common/errors.d.ts.map +1 -1
- package/lib/common/errors.js +3 -16
- package/lib/common/errors.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +1 -1
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-protocol.d.ts +53 -648
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +11 -34
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +2 -1
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +8 -3
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js +5 -36
- package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/browser/worker/worker-main.js +2 -1
- package/lib/hosted/browser/worker/worker-main.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.js +10 -9
- package/lib/hosted/common/hosted-plugin.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.spec.js +2 -0
- package/lib/hosted/common/hosted-plugin.spec.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +4 -68
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +1 -0
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.js +1 -0
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.d.ts.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +4 -2
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-reader.js +6 -4
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/plugin-service.js +1 -0
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.d.ts +3 -2
- package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +5 -23
- package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +38 -71
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +117 -768
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.spec.js +191 -0
- package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.d.ts +1 -1
- package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.js +46 -84
- package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
- package/lib/main/browser/comments/comments-service.d.ts +2 -0
- package/lib/main/browser/comments/comments-service.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-service.js +7 -1
- package/lib/main/browser/comments/comments-service.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts +2 -0
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +7 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts +2 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +9 -4
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +2 -21
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +1 -1
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-ext-widget.js +10 -20
- package/lib/main/browser/plugin-ext-widget.js.map +1 -1
- package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-service.js +2 -1
- package/lib/main/browser/plugin-icon-service.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +2 -1
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +2 -1
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/scm-main.d.ts.map +1 -1
- package/lib/main/browser/scm-main.js +3 -1
- package/lib/main/browser/scm-main.js.map +1 -1
- package/lib/main/browser/text-editor-model-service.d.ts +2 -1
- package/lib/main/browser/text-editor-model-service.d.ts.map +1 -1
- package/lib/main/browser/text-editor-model-service.js +6 -1
- package/lib/main/browser/text-editor-model-service.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +14 -9
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +28 -18
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +4 -2
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.js +3 -2
- package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
- package/lib/main/browser/webviews-main.d.ts +8 -1
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.js +22 -18
- package/lib/main/browser/webviews-main.js.map +1 -1
- package/lib/main/browser/webviews-main.spec.d.ts +2 -0
- package/lib/main/browser/webviews-main.spec.d.ts.map +1 -0
- package/lib/main/browser/webviews-main.spec.js +132 -0
- package/lib/main/browser/webviews-main.spec.js.map +1 -0
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +2 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +10 -4
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -0
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +9 -3
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +1 -0
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-deployer-contribution.js +1 -0
- package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +16 -13
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-service.d.ts +2 -0
- package/lib/main/node/plugin-service.d.ts.map +1 -1
- package/lib/main/node/plugin-service.js +7 -1
- package/lib/main/node/plugin-service.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts +2 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.js +6 -1
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.d.ts +2 -0
- package/lib/main/node/plugins-key-value-storage.d.ts.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +9 -3
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts +2 -0
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +7 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.d.ts +2 -0
- package/lib/main/node/webview-backend-security-warnings.d.ts.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.js +7 -1
- package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
- package/lib/plugin/scm.js +1 -1
- package/lib/plugin/scm.js.map +1 -1
- package/package.json +32 -31
- package/src/common/errors.ts +1 -25
- package/src/common/plugin-api-rpc.ts +1 -1
- package/src/common/plugin-protocol.ts +203 -662
- package/src/hosted/browser/hosted-plugin.ts +8 -5
- package/src/hosted/browser/worker/plugin-manifest-loader.ts +8 -41
- package/src/hosted/browser/worker/worker-main.ts +2 -1
- package/src/hosted/common/hosted-plugin.spec.ts +2 -0
- package/src/hosted/common/hosted-plugin.ts +10 -10
- package/src/hosted/node/hosted-plugin-localization-service.ts +3 -82
- package/src/hosted/node/hosted-plugin-process.ts +1 -1
- package/src/hosted/node/hosted-plugin.ts +2 -2
- package/src/hosted/node/plugin-host-rpc.ts +6 -3
- package/src/hosted/node/plugin-reader.ts +7 -6
- package/src/hosted/node/plugin-service.ts +1 -1
- package/src/hosted/node/scanners/grammars-reader.ts +14 -23
- package/src/hosted/node/scanners/scanner-theia.spec.ts +225 -1
- package/src/hosted/node/scanners/scanner-theia.ts +204 -881
- package/src/main/browser/comments/comments-service.ts +6 -2
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +6 -3
- package/src/main/browser/debug/plugin-debug-session-contribution-registry.ts +5 -1
- package/src/main/browser/menus/menus-contribution-handler.ts +9 -6
- package/src/main/browser/plugin-contribution-handler.ts +1 -1
- package/src/main/browser/plugin-icon-service.ts +2 -1
- package/src/main/browser/plugin-icon-theme-service.ts +2 -1
- package/src/main/browser/plugin-shared-style.ts +2 -1
- package/src/main/browser/scm-main.ts +3 -1
- package/src/main/browser/text-editor-model-service.ts +6 -3
- package/src/main/browser/view/plugin-view-registry.ts +14 -11
- package/src/main/browser/view/tree-view-widget.tsx +14 -7
- package/src/main/browser/webview/webview.ts +4 -2
- package/src/main/browser/webview-views/webview-views-main.ts +4 -4
- package/src/main/browser/webviews-main.spec.ts +160 -0
- package/src/main/browser/webviews-main.ts +22 -19
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +9 -6
- package/src/main/node/handlers/plugin-theia-file-handler.ts +8 -5
- package/src/main/node/paths/plugin-paths-service.ts +2 -2
- package/src/main/node/plugin-deployer-contribution.ts +2 -2
- package/src/main/node/plugin-deployer-impl.ts +20 -14
- package/src/main/node/plugin-service.ts +6 -2
- package/src/main/node/plugin-uninstallation-manager.ts +7 -4
- package/src/main/node/plugins-key-value-storage.ts +8 -4
- package/src/main/node/resolvers/local-plugin-deployer-resolver.ts +7 -2
- package/src/main/node/webview-backend-security-warnings.ts +6 -2
- package/src/plugin/scm.ts +1 -1
- package/lib/hosted/node/plugin-activation-events.d.ts +0 -7
- package/lib/hosted/node/plugin-activation-events.d.ts.map +0 -1
- package/lib/hosted/node/plugin-activation-events.js +0 -95
- package/lib/hosted/node/plugin-activation-events.js.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts +0 -3
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.js +0 -34
- package/lib/hosted/node/plugin-manifest-loader.js.map +0 -1
- package/lib/main/node/errors.spec.d.ts +0 -2
- package/lib/main/node/errors.spec.d.ts.map +0 -1
- package/lib/main/node/errors.spec.js +0 -36
- package/lib/main/node/errors.spec.js.map +0 -1
- package/src/hosted/node/plugin-activation-events.ts +0 -112
- package/src/hosted/node/plugin-manifest-loader.ts +0 -32
- package/src/main/node/errors.spec.ts +0 -37
|
@@ -135,8 +135,8 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
async $reveal(handle: string, showOptions: WebviewPanelShowOptions): Promise<void> {
|
|
138
|
-
const widget = await this.
|
|
139
|
-
if (widget.isDisposed) {
|
|
138
|
+
const widget = await this.tryGetWebview(handle);
|
|
139
|
+
if (!widget || widget.isDisposed) {
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
if ((showOptions.viewColumn !== undefined && showOptions.viewColumn !== widget.viewState.position) || showOptions.area !== undefined) {
|
|
@@ -156,22 +156,27 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
async $setTitle(handle: string, value: string): Promise<void> {
|
|
159
|
-
const webview = await this.
|
|
160
|
-
webview
|
|
159
|
+
const webview = await this.tryGetWebview(handle);
|
|
160
|
+
if (webview) {
|
|
161
|
+
webview.title.label = value;
|
|
162
|
+
}
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
async $setIconPath(handle: string, iconUrl: IconUrl | ThemeIcon | undefined): Promise<void> {
|
|
164
|
-
const webview = await this.
|
|
165
|
-
webview
|
|
166
|
+
const webview = await this.tryGetWebview(handle);
|
|
167
|
+
webview?.setIconUrl(iconUrl);
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
async $setHtml(handle: string, value: string): Promise<void> {
|
|
169
|
-
const webview = await this.
|
|
170
|
-
webview
|
|
171
|
+
const webview = await this.tryGetWebview(handle);
|
|
172
|
+
webview?.setHTML(value);
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
async $setOptions(handle: string, options: WebviewOptions): Promise<void> {
|
|
174
|
-
const webview = await this.
|
|
176
|
+
const webview = await this.tryGetWebview(handle);
|
|
177
|
+
if (!webview) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
175
180
|
const { enableScripts, enableForms, localResourceRoots, ...contentOptions } = options;
|
|
176
181
|
webview.setContentOptions({
|
|
177
182
|
allowScripts: enableScripts,
|
|
@@ -183,8 +188,6 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
|
|
|
183
188
|
|
|
184
189
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
185
190
|
async $postMessage(handle: string, value: any): Promise<boolean> {
|
|
186
|
-
// Due to async nature of $postMessage, the webview may have been disposed in the meantime.
|
|
187
|
-
// Therefore, don't throw an error if the webview is not found, but return false in this case.
|
|
188
191
|
const webview = await this.tryGetWebview(handle);
|
|
189
192
|
if (!webview) {
|
|
190
193
|
return false;
|
|
@@ -257,14 +260,14 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
|
|
|
257
260
|
this.proxy.$onDidChangeWebviewPanelViewState(widget.identifier.id, widget.viewState);
|
|
258
261
|
}
|
|
259
262
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Looks up the webview widget for the given handle.
|
|
265
|
+
*
|
|
266
|
+
* All `$`-methods of this class are invoked over RPC and resolve the widget asynchronously, so the webview may already
|
|
267
|
+
* have been disposed by the time they run. The plugin host declares most of them as returning `void` and therefore never
|
|
268
|
+
* attaches a rejection handler, so throwing here surfaces as an unhandled promise rejection in the plugin host. Callers
|
|
269
|
+
* must instead treat a missing webview as a no-op, the same way VS Code's `MainThreadWebviews` does.
|
|
270
|
+
*/
|
|
268
271
|
private async tryGetWebview(id: string): Promise<WebviewWidget | undefined> {
|
|
269
272
|
const webview = await this.widgetManager.findWidget<WebviewWidget>(WebviewWidget.FACTORY_ID, options => {
|
|
270
273
|
if (options) {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
import * as path from 'path';
|
|
18
18
|
import * as filenamify from 'filenamify';
|
|
19
19
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
|
-
import
|
|
21
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
20
|
+
import { URI, ILogger } from '@theia/core';
|
|
21
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
22
22
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
23
23
|
import { FileUri } from '@theia/core/lib/node';
|
|
24
24
|
import {
|
|
@@ -34,6 +34,9 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
34
34
|
|
|
35
35
|
@inject(PluginCliContribution) protected readonly pluginCli: PluginCliContribution;
|
|
36
36
|
|
|
37
|
+
@inject(ILogger) @named('plugin-ext:AbstractPluginDirectoryHandler')
|
|
38
|
+
protected readonly logger: ILogger;
|
|
39
|
+
|
|
37
40
|
constructor() {
|
|
38
41
|
this.deploymentDirectory = new Deferred();
|
|
39
42
|
getTempDirPathAsync('theia-copied')
|
|
@@ -42,7 +45,7 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
42
45
|
|
|
43
46
|
async accept(resolvedPlugin: PluginDeployerEntry): Promise<boolean> {
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
this.logger.debug(`Plugin directory handler: accepting plugin with path ${resolvedPlugin.path()}`);
|
|
46
49
|
|
|
47
50
|
// handle only directories
|
|
48
51
|
if (await resolvedPlugin.isFile()) {
|
|
@@ -89,9 +92,9 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
89
92
|
const targetDir = await this.getExtensionDir(context);
|
|
90
93
|
try {
|
|
91
94
|
if (await fs.pathExists(targetDir) || !entry.path().startsWith(origin)) {
|
|
92
|
-
|
|
95
|
+
this.logger.info(`[${id}]: already copied.`);
|
|
93
96
|
} else {
|
|
94
|
-
|
|
97
|
+
this.logger.info(`[${id}]: copying to "${targetDir}"`);
|
|
95
98
|
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
96
99
|
await fs.mkdirp(FileUri.fsPath(deploymentDirectory));
|
|
97
100
|
await context.copy(origin, targetDir);
|
|
@@ -101,7 +104,7 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
} catch (e) {
|
|
104
|
-
|
|
107
|
+
this.logger.warn(`[${id}]: Error when copying.`, e);
|
|
105
108
|
entry.updatePath(pathToRestore);
|
|
106
109
|
}
|
|
107
110
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { PluginDeployerFileHandler, PluginDeployerEntry, PluginDeployerFileHandlerContext, PluginType } from '../../../common/plugin-protocol';
|
|
18
|
-
import
|
|
19
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { URI, ILogger } from '@theia/core';
|
|
19
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
20
20
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
21
21
|
import { getTempDirPathAsync } from '../temp-dir-util';
|
|
22
22
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
@@ -32,6 +32,9 @@ export class PluginTheiaFileHandler implements PluginDeployerFileHandler {
|
|
|
32
32
|
@inject(PluginTheiaEnvironment)
|
|
33
33
|
protected readonly environment: PluginTheiaEnvironment;
|
|
34
34
|
|
|
35
|
+
@inject(ILogger) @named('plugin-ext:PluginTheiaFileHandler')
|
|
36
|
+
protected readonly logger: ILogger;
|
|
37
|
+
|
|
35
38
|
constructor() {
|
|
36
39
|
this.systemPluginsDirUri = new Deferred();
|
|
37
40
|
getTempDirPathAsync('theia-unpacked')
|
|
@@ -48,14 +51,14 @@ export class PluginTheiaFileHandler implements PluginDeployerFileHandler {
|
|
|
48
51
|
async handle(context: PluginDeployerFileHandlerContext): Promise<void> {
|
|
49
52
|
const id = context.pluginEntry().id();
|
|
50
53
|
const pluginDir = await this.getPluginDir(context);
|
|
51
|
-
|
|
54
|
+
this.logger.info(`[${id}]: trying to decompress into "${pluginDir}"...`);
|
|
52
55
|
if (context.pluginEntry().type === PluginType.User && await fs.pathExists(pluginDir)) {
|
|
53
|
-
|
|
56
|
+
this.logger.info(`[${id}]: already found`);
|
|
54
57
|
context.pluginEntry().updatePath(pluginDir);
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
60
|
await context.unzip(context.pluginEntry().path(), pluginDir);
|
|
58
|
-
|
|
61
|
+
this.logger.info(`[${id}]: decompressed`);
|
|
59
62
|
context.pluginEntry().updatePath(pluginDir);
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import URI from '@theia/core/lib/common/uri';
|
|
19
19
|
import * as path from 'path';
|
|
20
20
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
@@ -35,7 +35,7 @@ const SESSION_TIMESTAMP_PATTERN = /^\d{8}T\d{6}$/;
|
|
|
35
35
|
@injectable()
|
|
36
36
|
export class PluginPathsServiceImpl implements PluginPathsService {
|
|
37
37
|
|
|
38
|
-
@inject(ILogger)
|
|
38
|
+
@inject(ILogger) @named('plugin-ext:PluginPathsServiceImpl')
|
|
39
39
|
protected readonly logger: ILogger;
|
|
40
40
|
|
|
41
41
|
@inject(EnvVariablesServer)
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
18
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { PluginDeployer } from '../../common/plugin-protocol';
|
|
20
20
|
import { ILogger } from '@theia/core';
|
|
21
21
|
|
|
22
22
|
@injectable()
|
|
23
23
|
export class PluginDeployerContribution implements BackendApplicationContribution {
|
|
24
24
|
|
|
25
|
-
@inject(ILogger)
|
|
25
|
+
@inject(ILogger) @named('plugin-ext:PluginDeployerContribution')
|
|
26
26
|
protected readonly logger: ILogger;
|
|
27
27
|
|
|
28
28
|
@inject(PluginDeployer)
|
|
@@ -293,30 +293,36 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
293
293
|
* deploy all plugins that have been accepted
|
|
294
294
|
*/
|
|
295
295
|
async deployPlugins(pluginsToDeploy: PluginDeployerEntry[]): Promise<number> {
|
|
296
|
-
const acceptedPlugins = pluginsToDeploy.filter(pluginDeployerEntry =>
|
|
296
|
+
const acceptedPlugins = pluginsToDeploy.filter(pluginDeployerEntry =>
|
|
297
|
+
pluginDeployerEntry.isAccepted(PluginDeployerEntryType.FRONTEND, PluginDeployerEntryType.BACKEND, PluginDeployerEntryType.HEADLESS));
|
|
297
298
|
const acceptedFrontendPlugins = pluginsToDeploy.filter(pluginDeployerEntry => pluginDeployerEntry.isAccepted(PluginDeployerEntryType.FRONTEND));
|
|
298
299
|
const acceptedBackendPlugins = pluginsToDeploy.filter(pluginDeployerEntry => pluginDeployerEntry.isAccepted(PluginDeployerEntryType.BACKEND));
|
|
299
300
|
const acceptedHeadlessPlugins = pluginsToDeploy.filter(pluginDeployerEntry => pluginDeployerEntry.isAccepted(PluginDeployerEntryType.HEADLESS));
|
|
300
301
|
|
|
301
|
-
this.logger.debug(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
302
|
+
this.logger.debug(log => {
|
|
303
|
+
log('the accepted plugins are', acceptedPlugins);
|
|
304
|
+
log('the acceptedFrontendPlugins plugins are', acceptedFrontendPlugins);
|
|
305
|
+
log('the acceptedBackendPlugins plugins are', acceptedBackendPlugins);
|
|
306
|
+
log('the acceptedHeadlessPlugins plugins are', acceptedHeadlessPlugins);
|
|
307
|
+
acceptedPlugins.forEach(plugin => {
|
|
308
|
+
log(
|
|
309
|
+
'will deploy plugin', plugin.id(), 'with changes', JSON.stringify(plugin.getChanges()),
|
|
310
|
+
'and this plugin has been resolved by', plugin.resolvedBy()
|
|
311
|
+
);
|
|
312
|
+
});
|
|
308
313
|
});
|
|
309
314
|
|
|
310
315
|
// local path to launch
|
|
311
316
|
const pluginPaths = [...acceptedBackendPlugins, ...acceptedHeadlessPlugins].map(pluginEntry => pluginEntry.path());
|
|
312
317
|
this.logger.debug('local path to deploy on remote instance', pluginPaths);
|
|
313
318
|
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
319
|
+
const deployPluginsMeasurement = this.measure('deployPluginsBatch');
|
|
320
|
+
const deployments = await Promise.all([
|
|
321
|
+
// start the backend and headless plugins
|
|
322
|
+
this.pluginDeployerHandler.deployBackendPlugins([...acceptedBackendPlugins, ...acceptedHeadlessPlugins]),
|
|
323
|
+
this.pluginDeployerHandler.deployFrontendPlugins(acceptedFrontendPlugins)
|
|
324
|
+
]);
|
|
325
|
+
deployPluginsMeasurement.log(`Deploy batch of ${acceptedPlugins.length} accepted plugins`);
|
|
320
326
|
this.onDidDeployEmitter.fire(undefined);
|
|
321
327
|
return deployments.reduce<number>((accumulated, current) => accumulated += current ?? 0, 0);
|
|
322
328
|
}
|
|
@@ -19,13 +19,14 @@ import * as path from 'path';
|
|
|
19
19
|
const vhost = require('vhost');
|
|
20
20
|
import * as express from '@theia/core/shared/express';
|
|
21
21
|
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
22
|
-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
22
|
+
import { inject, injectable, postConstruct, named } from '@theia/core/shared/inversify';
|
|
23
23
|
import { WebviewExternalEndpoint } from '../common/webview-protocol';
|
|
24
24
|
import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
|
|
25
25
|
import { WsRequestValidatorContribution } from '@theia/core/lib/node/ws-request-validators';
|
|
26
26
|
import { MaybePromise } from '@theia/core/lib/common';
|
|
27
27
|
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
28
28
|
import { BackendRemoteService } from '@theia/core/lib/node/remote/backend-remote-service';
|
|
29
|
+
import { ILogger } from '@theia/core';
|
|
29
30
|
|
|
30
31
|
@injectable()
|
|
31
32
|
export class PluginApiContribution implements BackendApplicationContribution, WsRequestValidatorContribution {
|
|
@@ -40,10 +41,13 @@ export class PluginApiContribution implements BackendApplicationContribution, Ws
|
|
|
40
41
|
@inject(BackendRemoteService)
|
|
41
42
|
protected readonly remoteService: BackendRemoteService;
|
|
42
43
|
|
|
44
|
+
@inject(ILogger) @named('plugin-ext:PluginApiContribution')
|
|
45
|
+
protected readonly logger: ILogger;
|
|
46
|
+
|
|
43
47
|
@postConstruct()
|
|
44
48
|
protected init(): void {
|
|
45
49
|
const webviewExternalEndpoint = this.webviewExternalEndpoint();
|
|
46
|
-
|
|
50
|
+
this.logger.info(`Configuring to accept webviews on '${webviewExternalEndpoint}' hostname.`);
|
|
47
51
|
this.webviewExternalEndpointRegExp = new RegExp(webviewExternalEndpoint, 'i');
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { Emitter, Event } from '@theia/core';
|
|
18
|
-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
17
|
+
import { Emitter, Event, ILogger } from '@theia/core';
|
|
18
|
+
import { inject, injectable, postConstruct, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { PluginIdentifiers } from '../../common';
|
|
20
20
|
import { SettingService } from '@theia/core/lib/node';
|
|
21
21
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
@@ -27,6 +27,9 @@ export class PluginUninstallationManager {
|
|
|
27
27
|
@inject(SettingService)
|
|
28
28
|
protected readonly settingService: SettingService;
|
|
29
29
|
|
|
30
|
+
@inject(ILogger) @named('plugin-ext:PluginUninstallationManager')
|
|
31
|
+
protected readonly logger: ILogger;
|
|
32
|
+
|
|
30
33
|
protected readonly onDidChangeUninstalledPluginsEmitter = new Emitter<readonly PluginIdentifiers.VersionedId[]>();
|
|
31
34
|
onDidChangeUninstalledPlugins: Event<readonly PluginIdentifiers.VersionedId[]> = this.onDidChangeUninstalledPluginsEmitter.event;
|
|
32
35
|
|
|
@@ -46,12 +49,12 @@ export class PluginUninstallationManager {
|
|
|
46
49
|
protected async load(): Promise<void> {
|
|
47
50
|
try {
|
|
48
51
|
const disabled: (PluginIdentifiers.VersionedId | PluginIdentifiers.UnversionedId)[] =
|
|
49
|
-
|
|
52
|
+
JSON.parse(await this.settingService.get(PluginUninstallationManager.DISABLED_PLUGINS) || '[]');
|
|
50
53
|
|
|
51
54
|
disabled.forEach(id => this.disabledPlugins.add(PluginIdentifiers.toUnversioned(id)));
|
|
52
55
|
} catch (e) {
|
|
53
56
|
// settings may be corrupt; just carry on
|
|
54
|
-
|
|
57
|
+
this.logger.warn(e);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, postConstruct, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { FileSystemLocking } from '@theia/core/lib/node';
|
|
19
19
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
20
|
import * as path from 'path';
|
|
@@ -25,6 +25,7 @@ import { PluginPaths } from './paths/const';
|
|
|
25
25
|
import { PluginPathsService } from '../common/plugin-paths-protocol';
|
|
26
26
|
import { KeysToAnyValues, KeysToKeysToAnyValue } from '../../common/types';
|
|
27
27
|
import { PluginStorageKind } from '../../common';
|
|
28
|
+
import { ILogger } from '@theia/core';
|
|
28
29
|
|
|
29
30
|
export interface Store {
|
|
30
31
|
fsPath: string
|
|
@@ -49,10 +50,13 @@ export class PluginsKeyValueStorage {
|
|
|
49
50
|
@inject(FileSystemLocking)
|
|
50
51
|
private fsLocking: FileSystemLocking;
|
|
51
52
|
|
|
53
|
+
@inject(ILogger) @named('plugin-ext:PluginsKeyValueStorage')
|
|
54
|
+
protected readonly logger: ILogger;
|
|
55
|
+
|
|
52
56
|
@postConstruct()
|
|
53
57
|
protected init(): void {
|
|
54
58
|
this.deferredGlobalDataPath.resolve(this.getGlobalDataPath().catch(error => {
|
|
55
|
-
|
|
59
|
+
this.logger.error('Failed to initialize global state path:', error);
|
|
56
60
|
return undefined;
|
|
57
61
|
}));
|
|
58
62
|
process.once('beforeExit', () => this.dispose());
|
|
@@ -62,7 +66,7 @@ export class PluginsKeyValueStorage {
|
|
|
62
66
|
async set(key: string, value: KeysToAnyValues, kind: PluginStorageKind): Promise<boolean> {
|
|
63
67
|
const store = await this.getStore(kind);
|
|
64
68
|
if (!store) {
|
|
65
|
-
|
|
69
|
+
this.logger.warn('Cannot save data: no opened workspace');
|
|
66
70
|
return false;
|
|
67
71
|
}
|
|
68
72
|
if (value === undefined || Object.keys(value).length === 0) {
|
|
@@ -144,7 +148,7 @@ export class PluginsKeyValueStorage {
|
|
|
144
148
|
try {
|
|
145
149
|
return await fs.readJSON(pathToFile);
|
|
146
150
|
} catch (error) {
|
|
147
|
-
|
|
151
|
+
this.logger.error('Failed to parse data from "', pathToFile, '". Reason:', error);
|
|
148
152
|
return {};
|
|
149
153
|
}
|
|
150
154
|
}
|
|
@@ -14,15 +14,20 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { PluginDeployerResolver, PluginDeployerResolverContext } from '../../../common/plugin-protocol';
|
|
19
19
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
20
|
import * as path from 'path';
|
|
21
21
|
import { FileUri } from '@theia/core/lib/node';
|
|
22
22
|
import URI from '@theia/core/lib/common/uri';
|
|
23
|
+
import { ILogger } from '@theia/core';
|
|
23
24
|
|
|
24
25
|
@injectable()
|
|
25
26
|
export abstract class LocalPluginDeployerResolver implements PluginDeployerResolver {
|
|
27
|
+
|
|
28
|
+
@inject(ILogger) @named('plugin-ext:LocalPluginDeployerResolver')
|
|
29
|
+
protected readonly logger: ILogger;
|
|
30
|
+
|
|
26
31
|
async resolve(pluginResolverContext: PluginDeployerResolverContext): Promise<void> {
|
|
27
32
|
const localPath = await this.resolveLocalPluginPath(pluginResolverContext, this.supportedScheme);
|
|
28
33
|
if (localPath) {
|
|
@@ -48,7 +53,7 @@ export abstract class LocalPluginDeployerResolver implements PluginDeployerResol
|
|
|
48
53
|
fsPath = path.resolve(process.cwd(), fsPath);
|
|
49
54
|
}
|
|
50
55
|
if (!await fs.pathExists(fsPath)) {
|
|
51
|
-
|
|
56
|
+
this.logger.warn(`The local plugin referenced by ${pluginResolverContext.getOriginId()} does not exist.`);
|
|
52
57
|
return null;
|
|
53
58
|
}
|
|
54
59
|
return fsPath;
|
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
|
|
17
17
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
18
18
|
import { BackendApplicationConfigProvider } from '@theia/core/lib/node/backend-application-config-provider';
|
|
19
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
20
20
|
import { WebviewExternalEndpoint } from '../common/webview-protocol';
|
|
21
|
+
import { ILogger } from '@theia/core';
|
|
21
22
|
|
|
22
23
|
@injectable()
|
|
23
24
|
export class WebviewBackendSecurityWarnings implements BackendApplicationContribution {
|
|
24
25
|
|
|
26
|
+
@inject(ILogger) @named('plugin-ext:WebviewBackendSecurityWarnings')
|
|
27
|
+
protected readonly logger: ILogger;
|
|
28
|
+
|
|
25
29
|
initialize(): void {
|
|
26
30
|
this.checkHostPattern();
|
|
27
31
|
}
|
|
@@ -32,7 +36,7 @@ export class WebviewBackendSecurityWarnings implements BackendApplicationContrib
|
|
|
32
36
|
}
|
|
33
37
|
const envHostPattern = process.env[WebviewExternalEndpoint.pattern];
|
|
34
38
|
if (envHostPattern && envHostPattern !== WebviewExternalEndpoint.defaultPattern) {
|
|
35
|
-
|
|
39
|
+
this.logger.warn(`\
|
|
36
40
|
WEBVIEW SECURITY WARNING
|
|
37
41
|
|
|
38
42
|
Changing the @theia/plugin-ext webview host pattern can lead to security vulnerabilities.
|
package/src/plugin/scm.ts
CHANGED
|
@@ -566,7 +566,7 @@ function historyItemToDto(item: theia.SourceControlHistoryItem): ScmHistoryItemD
|
|
|
566
566
|
authorIcon: item.authorIcon,
|
|
567
567
|
displayId: item.displayId,
|
|
568
568
|
timestamp: item.timestamp,
|
|
569
|
-
tooltip: item.tooltip,
|
|
569
|
+
tooltip: Array.isArray(item.tooltip) ? [...item.tooltip] : item.tooltip,
|
|
570
570
|
statistics: item.statistics ? {
|
|
571
571
|
files: item.statistics.files,
|
|
572
572
|
insertions: item.statistics.insertions,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PluginPackage } from '../../common/plugin-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* Most activation events can be automatically deduced from the package manifest.
|
|
4
|
-
* This function will update the manifest based on the plugin contributions.
|
|
5
|
-
*/
|
|
6
|
-
export declare function updateActivationEvents(manifest: PluginPackage): void;
|
|
7
|
-
//# sourceMappingURL=plugin-activation-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-activation-events.d.ts","sourceRoot":"","sources":["../../../src/hosted/node/plugin-activation-events.ts"],"names":[],"mappings":"AAkBA,OAAO,EACH,aAAa,EAQhB,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CA8BpE"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.updateActivationEvents = updateActivationEvents;
|
|
19
|
-
const arrays_1 = require("../../common/arrays");
|
|
20
|
-
const types_1 = require("@theia/core/lib/common/types");
|
|
21
|
-
/**
|
|
22
|
-
* Most activation events can be automatically deduced from the package manifest.
|
|
23
|
-
* This function will update the manifest based on the plugin contributions.
|
|
24
|
-
*/
|
|
25
|
-
function updateActivationEvents(manifest) {
|
|
26
|
-
if (!(0, types_1.isObject)(manifest) || !(0, types_1.isObject)(manifest.contributes) || !manifest.contributes) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const activationEvents = new Set((0, types_1.isStringArray)(manifest.activationEvents) ? manifest.activationEvents : []);
|
|
30
|
-
if (manifest.contributes.commands) {
|
|
31
|
-
const value = manifest.contributes.commands;
|
|
32
|
-
const commands = Array.isArray(value) ? value : [value];
|
|
33
|
-
updateCommandsContributions(commands, activationEvents);
|
|
34
|
-
}
|
|
35
|
-
if ((0, types_1.isObject)(manifest.contributes.views)) {
|
|
36
|
-
const views = (0, arrays_1.flatten)(Object.values(manifest.contributes.views));
|
|
37
|
-
updateViewsContribution(views, activationEvents);
|
|
38
|
-
}
|
|
39
|
-
if (Array.isArray(manifest.contributes.customEditors)) {
|
|
40
|
-
updateCustomEditorsContribution(manifest.contributes.customEditors, activationEvents);
|
|
41
|
-
}
|
|
42
|
-
if (Array.isArray(manifest.contributes.authentication)) {
|
|
43
|
-
updateAuthenticationProviderContributions(manifest.contributes.authentication, activationEvents);
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(manifest.contributes.languages)) {
|
|
46
|
-
updateLanguageContributions(manifest.contributes.languages, activationEvents);
|
|
47
|
-
}
|
|
48
|
-
if (Array.isArray(manifest.contributes.notebooks)) {
|
|
49
|
-
updateNotebookContributions(manifest.contributes.notebooks, activationEvents);
|
|
50
|
-
}
|
|
51
|
-
manifest.activationEvents = Array.from(activationEvents);
|
|
52
|
-
}
|
|
53
|
-
function updateViewsContribution(views, activationEvents) {
|
|
54
|
-
for (const view of views) {
|
|
55
|
-
if ((0, types_1.isObject)(view) && typeof view.id === 'string') {
|
|
56
|
-
activationEvents.add(`onView:${view.id}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function updateCustomEditorsContribution(customEditors, activationEvents) {
|
|
61
|
-
for (const customEditor of customEditors) {
|
|
62
|
-
if ((0, types_1.isObject)(customEditor) && typeof customEditor.viewType === 'string') {
|
|
63
|
-
activationEvents.add(`onCustomEditor:${customEditor.viewType}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function updateCommandsContributions(commands, activationEvents) {
|
|
68
|
-
for (const command of commands) {
|
|
69
|
-
if ((0, types_1.isObject)(command) && typeof command.command === 'string') {
|
|
70
|
-
activationEvents.add(`onCommand:${command.command}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function updateAuthenticationProviderContributions(authProviders, activationEvents) {
|
|
75
|
-
for (const authProvider of authProviders) {
|
|
76
|
-
if ((0, types_1.isObject)(authProvider) && typeof authProvider.id === 'string') {
|
|
77
|
-
activationEvents.add(`onAuthenticationRequest:${authProvider.id}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function updateLanguageContributions(languages, activationEvents) {
|
|
82
|
-
for (const language of languages) {
|
|
83
|
-
if ((0, types_1.isObject)(language) && typeof language.id === 'string') {
|
|
84
|
-
activationEvents.add(`onLanguage:${language.id}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
function updateNotebookContributions(notebooks, activationEvents) {
|
|
89
|
-
for (const notebook of notebooks) {
|
|
90
|
-
if ((0, types_1.isObject)(notebook) && typeof notebook.type === 'string') {
|
|
91
|
-
activationEvents.add(`onNotebookSerializer:${notebook.type}`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=plugin-activation-events.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-activation-events.js","sourceRoot":"","sources":["../../../src/hosted/node/plugin-activation-events.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAw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gB,CAAC,GAAG,CAAC,wBAAwB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-manifest-loader.d.ts","sourceRoot":"","sources":["../../../src/hosted/node/plugin-manifest-loader.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAqB,aAAa,EAAE,MAAM,cAAc,CAAC;AAGhE,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAU7E"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.loadManifest = loadManifest;
|
|
19
|
-
const path = require("path");
|
|
20
|
-
const fs = require("@theia/core/shared/fs-extra");
|
|
21
|
-
const common_1 = require("../../common");
|
|
22
|
-
const plugin_activation_events_1 = require("./plugin-activation-events");
|
|
23
|
-
async function loadManifest(pluginPath) {
|
|
24
|
-
const manifest = await fs.readJson(path.join(pluginPath, 'package.json'));
|
|
25
|
-
// translate vscode builtins, as they are published with a prefix. See https://github.com/theia-ide/vscode-builtin-extensions/blob/master/src/republish.js#L50
|
|
26
|
-
const built_prefix = '@theia/vscode-builtin-';
|
|
27
|
-
if (manifest && manifest.name && manifest.name.startsWith(built_prefix)) {
|
|
28
|
-
manifest.name = manifest.name.substring(built_prefix.length);
|
|
29
|
-
}
|
|
30
|
-
manifest.publisher ??= common_1.PluginIdentifiers.UNPUBLISHED;
|
|
31
|
-
(0, plugin_activation_events_1.updateActivationEvents)(manifest);
|
|
32
|
-
return manifest;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=plugin-manifest-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-manifest-loader.js","sourceRoot":"","sources":["../../../src/hosted/node/plugin-manifest-loader.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAOhF,oCAUC;AAfD,6BAA6B;AAC7B,kDAAkD;AAClD,yCAAgE;AAChE,yEAAoE;AAE7D,KAAK,UAAU,YAAY,CAAC,UAAkB;IACjD,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;IAC1E,8JAA8J;IAC9J,MAAM,YAAY,GAAG,wBAAwB,CAAC;IAC9C,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACtE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IACD,QAAQ,CAAC,SAAS,KAAK,0BAAiB,CAAC,WAAW,CAAC;IACrD,IAAA,iDAAsB,EAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.spec.d.ts","sourceRoot":"","sources":["../../../src/main/node/errors.spec.ts"],"names":[],"mappings":""}
|