@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
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 Arduino SA 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
|
-
const assert_1 = require("assert");
|
|
19
|
-
const strict_1 = require("assert/strict");
|
|
20
|
-
const fs_1 = require("fs");
|
|
21
|
-
const uuid_1 = require("@theia/core/lib/common/uuid");
|
|
22
|
-
const errors_1 = require("../../common/errors");
|
|
23
|
-
describe('errors', () => {
|
|
24
|
-
describe('errno-exception', () => {
|
|
25
|
-
it('should be ENOENT error', async () => {
|
|
26
|
-
await (0, assert_1.rejects)(fs_1.promises.readFile((0, uuid_1.generateUuid)()), reason => (0, errors_1.isENOENT)(reason));
|
|
27
|
-
});
|
|
28
|
-
it('should not be ENOENT error (no code)', () => {
|
|
29
|
-
(0, strict_1.strictEqual)((0, errors_1.isENOENT)(new Error('I am not ENOENT')), false);
|
|
30
|
-
});
|
|
31
|
-
it('should not be ENOENT error (other code)', async () => {
|
|
32
|
-
await (0, assert_1.rejects)(fs_1.promises.readdir(__filename), reason => !(0, errors_1.isENOENT)(reason));
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=errors.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.spec.js","sourceRoot":"","sources":["../../../src/main/node/errors.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,4CAA4C;AAC5C,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;;AAEhF,mCAAiC;AACjC,0CAA4C;AAC5C,2BAAoC;AACpC,sDAA2D;AAC3D,gDAA+C;AAE/C,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACpB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACpC,MAAM,IAAA,gBAAO,EAAC,aAAE,CAAC,QAAQ,CAAC,IAAA,mBAAY,GAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC5C,IAAA,oBAAW,EAAC,IAAA,iBAAQ,EAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,IAAA,gBAAO,EAAC,aAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { flatten } from '../../common/arrays';
|
|
18
|
-
import { isStringArray, isObject } from '@theia/core/lib/common/types';
|
|
19
|
-
import {
|
|
20
|
-
PluginPackage,
|
|
21
|
-
PluginPackageAuthenticationProvider,
|
|
22
|
-
PluginPackageCommand,
|
|
23
|
-
PluginPackageContribution,
|
|
24
|
-
PluginPackageCustomEditor,
|
|
25
|
-
PluginPackageLanguageContribution,
|
|
26
|
-
PluginPackageNotebook,
|
|
27
|
-
PluginPackageView
|
|
28
|
-
} from '../../common/plugin-protocol';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Most activation events can be automatically deduced from the package manifest.
|
|
32
|
-
* This function will update the manifest based on the plugin contributions.
|
|
33
|
-
*/
|
|
34
|
-
export function updateActivationEvents(manifest: PluginPackage): void {
|
|
35
|
-
if (!isObject<PluginPackage>(manifest) || !isObject<PluginPackageContribution>(manifest.contributes) || !manifest.contributes) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const activationEvents = new Set(isStringArray(manifest.activationEvents) ? manifest.activationEvents : []);
|
|
40
|
-
|
|
41
|
-
if (manifest.contributes.commands) {
|
|
42
|
-
const value = manifest.contributes.commands;
|
|
43
|
-
const commands = Array.isArray(value) ? value : [value];
|
|
44
|
-
updateCommandsContributions(commands, activationEvents);
|
|
45
|
-
}
|
|
46
|
-
if (isObject(manifest.contributes.views)) {
|
|
47
|
-
const views = flatten(Object.values(manifest.contributes.views));
|
|
48
|
-
updateViewsContribution(views, activationEvents);
|
|
49
|
-
}
|
|
50
|
-
if (Array.isArray(manifest.contributes.customEditors)) {
|
|
51
|
-
updateCustomEditorsContribution(manifest.contributes.customEditors, activationEvents);
|
|
52
|
-
}
|
|
53
|
-
if (Array.isArray(manifest.contributes.authentication)) {
|
|
54
|
-
updateAuthenticationProviderContributions(manifest.contributes.authentication, activationEvents);
|
|
55
|
-
}
|
|
56
|
-
if (Array.isArray(manifest.contributes.languages)) {
|
|
57
|
-
updateLanguageContributions(manifest.contributes.languages, activationEvents);
|
|
58
|
-
}
|
|
59
|
-
if (Array.isArray(manifest.contributes.notebooks)) {
|
|
60
|
-
updateNotebookContributions(manifest.contributes.notebooks, activationEvents);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
manifest.activationEvents = Array.from(activationEvents);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function updateViewsContribution(views: PluginPackageView[], activationEvents: Set<string>): void {
|
|
67
|
-
for (const view of views) {
|
|
68
|
-
if (isObject<PluginPackageView>(view) && typeof view.id === 'string') {
|
|
69
|
-
activationEvents.add(`onView:${view.id}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function updateCustomEditorsContribution(customEditors: PluginPackageCustomEditor[], activationEvents: Set<string>): void {
|
|
75
|
-
for (const customEditor of customEditors) {
|
|
76
|
-
if (isObject<PluginPackageCustomEditor>(customEditor) && typeof customEditor.viewType === 'string') {
|
|
77
|
-
activationEvents.add(`onCustomEditor:${customEditor.viewType}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function updateCommandsContributions(commands: PluginPackageCommand[], activationEvents: Set<string>): void {
|
|
83
|
-
for (const command of commands) {
|
|
84
|
-
if (isObject<PluginPackageCommand>(command) && typeof command.command === 'string') {
|
|
85
|
-
activationEvents.add(`onCommand:${command.command}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function updateAuthenticationProviderContributions(authProviders: PluginPackageAuthenticationProvider[], activationEvents: Set<string>): void {
|
|
91
|
-
for (const authProvider of authProviders) {
|
|
92
|
-
if (isObject<PluginPackageAuthenticationProvider>(authProvider) && typeof authProvider.id === 'string') {
|
|
93
|
-
activationEvents.add(`onAuthenticationRequest:${authProvider.id}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function updateLanguageContributions(languages: PluginPackageLanguageContribution[], activationEvents: Set<string>): void {
|
|
99
|
-
for (const language of languages) {
|
|
100
|
-
if (isObject<PluginPackageLanguageContribution>(language) && typeof language.id === 'string') {
|
|
101
|
-
activationEvents.add(`onLanguage:${language.id}`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function updateNotebookContributions(notebooks: PluginPackageNotebook[], activationEvents: Set<string>): void {
|
|
107
|
-
for (const notebook of notebooks) {
|
|
108
|
-
if (isObject<PluginPackageNotebook>(notebook) && typeof notebook.type === 'string') {
|
|
109
|
-
activationEvents.add(`onNotebookSerializer:${notebook.type}`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as path from 'path';
|
|
18
|
-
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
|
-
import { PluginIdentifiers, PluginPackage } from '../../common';
|
|
20
|
-
import { updateActivationEvents } from './plugin-activation-events';
|
|
21
|
-
|
|
22
|
-
export async function loadManifest(pluginPath: string): Promise<PluginPackage> {
|
|
23
|
-
const manifest = await fs.readJson(path.join(pluginPath, 'package.json'));
|
|
24
|
-
// 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
|
|
25
|
-
const built_prefix = '@theia/vscode-builtin-';
|
|
26
|
-
if (manifest && manifest.name && manifest.name.startsWith(built_prefix)) {
|
|
27
|
-
manifest.name = manifest.name.substring(built_prefix.length);
|
|
28
|
-
}
|
|
29
|
-
manifest.publisher ??= PluginIdentifiers.UNPUBLISHED;
|
|
30
|
-
updateActivationEvents(manifest);
|
|
31
|
-
return manifest;
|
|
32
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 Arduino SA and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { rejects } from 'assert';
|
|
18
|
-
import { strictEqual } from 'assert/strict';
|
|
19
|
-
import { promises as fs } from 'fs';
|
|
20
|
-
import { generateUuid } from '@theia/core/lib/common/uuid';
|
|
21
|
-
import { isENOENT } from '../../common/errors';
|
|
22
|
-
|
|
23
|
-
describe('errors', () => {
|
|
24
|
-
describe('errno-exception', () => {
|
|
25
|
-
it('should be ENOENT error', async () => {
|
|
26
|
-
await rejects(fs.readFile(generateUuid()), reason => isENOENT(reason));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('should not be ENOENT error (no code)', () => {
|
|
30
|
-
strictEqual(isENOENT(new Error('I am not ENOENT')), false);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should not be ENOENT error (other code)', async () => {
|
|
34
|
-
await rejects(fs.readdir(__filename), reason => !isENOENT(reason));
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|