@theia/vsx-registry 1.46.1 → 1.47.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/browser/recommended-extensions/preference-provider-overrides.js +4 -9
- package/lib/browser/recommended-extensions/preference-provider-overrides.js.map +1 -1
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +10 -18
- package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js.map +1 -1
- package/lib/browser/vsx-extension-argument-processor.d.ts +5 -0
- package/lib/browser/vsx-extension-argument-processor.d.ts.map +1 -0
- package/lib/browser/vsx-extension-argument-processor.js +34 -0
- package/lib/browser/vsx-extension-argument-processor.js.map +1 -0
- package/lib/browser/vsx-extension-commands.d.ts +1 -0
- package/lib/browser/vsx-extension-commands.d.ts.map +1 -1
- package/lib/browser/vsx-extension-commands.js +5 -0
- package/lib/browser/vsx-extension-commands.js.map +1 -1
- package/lib/browser/vsx-extension-editor-manager.js +3 -8
- package/lib/browser/vsx-extension-editor-manager.js.map +1 -1
- package/lib/browser/vsx-extension-editor.js +10 -18
- package/lib/browser/vsx-extension-editor.js.map +1 -1
- package/lib/browser/vsx-extension.d.ts +1 -0
- package/lib/browser/vsx-extension.d.ts.map +1 -1
- package/lib/browser/vsx-extension.js +36 -39
- package/lib/browser/vsx-extension.js.map +1 -1
- package/lib/browser/vsx-extensions-contribution.d.ts +18 -8
- package/lib/browser/vsx-extensions-contribution.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-contribution.js +85 -64
- package/lib/browser/vsx-extensions-contribution.js.map +1 -1
- package/lib/browser/vsx-extensions-model.js +24 -32
- package/lib/browser/vsx-extensions-model.js.map +1 -1
- package/lib/browser/vsx-extensions-search-bar.js +12 -20
- package/lib/browser/vsx-extensions-search-bar.js.map +1 -1
- package/lib/browser/vsx-extensions-search-model.js +2 -7
- package/lib/browser/vsx-extensions-search-model.js.map +1 -1
- package/lib/browser/vsx-extensions-source.js +11 -19
- package/lib/browser/vsx-extensions-source.js.map +1 -1
- package/lib/browser/vsx-extensions-view-container.js +10 -18
- package/lib/browser/vsx-extensions-view-container.js.map +1 -1
- package/lib/browser/vsx-extensions-widget.d.ts +2 -1
- package/lib/browser/vsx-extensions-widget.d.ts.map +1 -1
- package/lib/browser/vsx-extensions-widget.js +19 -19
- package/lib/browser/vsx-extensions-widget.js.map +1 -1
- package/lib/browser/vsx-language-quick-pick-service.js +11 -19
- package/lib/browser/vsx-language-quick-pick-service.js.map +1 -1
- package/lib/browser/vsx-registry-frontend-module.d.ts.map +1 -1
- package/lib/browser/vsx-registry-frontend-module.js +4 -0
- package/lib/browser/vsx-registry-frontend-module.js.map +1 -1
- package/lib/node/vsx-cli-deployer-participant.d.ts +7 -0
- package/lib/node/vsx-cli-deployer-participant.d.ts.map +1 -0
- package/lib/node/vsx-cli-deployer-participant.js +52 -0
- package/lib/node/vsx-cli-deployer-participant.js.map +1 -0
- package/lib/node/vsx-cli.d.ts +1 -0
- package/lib/node/vsx-cli.d.ts.map +1 -1
- package/lib/node/vsx-cli.js +17 -7
- package/lib/node/vsx-cli.js.map +1 -1
- package/lib/node/vsx-environment-impl.js +6 -14
- package/lib/node/vsx-environment-impl.js.map +1 -1
- package/lib/node/vsx-extension-resolver.d.ts.map +1 -1
- package/lib/node/vsx-extension-resolver.js +22 -29
- package/lib/node/vsx-extension-resolver.js.map +1 -1
- package/lib/node/vsx-registry-backend-module.d.ts.map +1 -1
- package/lib/node/vsx-registry-backend-module.js +3 -0
- package/lib/node/vsx-registry-backend-module.js.map +1 -1
- package/package.json +12 -11
- package/src/browser/vsx-extension-argument-processor.ts +32 -0
- package/src/browser/vsx-extension-commands.ts +5 -0
- package/src/browser/vsx-extension-editor-manager.ts +1 -1
- package/src/browser/vsx-extension.tsx +7 -1
- package/src/browser/vsx-extensions-contribution.ts +56 -24
- package/src/browser/vsx-extensions-widget.tsx +10 -1
- package/src/browser/vsx-language-quick-pick-service.ts +1 -1
- package/src/browser/vsx-registry-frontend-module.ts +5 -0
- package/src/node/vsx-cli-deployer-participant.ts +46 -0
- package/src/node/vsx-cli.ts +13 -0
- package/src/node/vsx-extension-resolver.ts +8 -7
- package/src/node/vsx-registry-backend-module.ts +4 -1
|
@@ -14,18 +14,10 @@
|
|
|
14
14
|
//
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
17
|
var VSXExtensionResolver_1;
|
|
27
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
19
|
exports.VSXExtensionResolver = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
29
21
|
const path = require("path");
|
|
30
22
|
const semver = require("semver");
|
|
31
23
|
const fs = require("@theia/core/shared/fs-extra");
|
|
@@ -50,14 +42,15 @@ let VSXExtensionResolver = VSXExtensionResolver_1 = class VSXExtensionResolver {
|
|
|
50
42
|
}
|
|
51
43
|
let extension;
|
|
52
44
|
const client = await this.clientProvider();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
const version = (options === null || options === void 0 ? void 0 : options.version) || id.version;
|
|
46
|
+
if (version) {
|
|
47
|
+
console.log(`[${id}]: trying to resolve version ${version}...`);
|
|
48
|
+
const { extensions } = await client.query({ extensionId: id.id, extensionVersion: version, includeAllVersions: true });
|
|
56
49
|
extension = extensions[0];
|
|
57
50
|
}
|
|
58
51
|
else {
|
|
59
52
|
console.log(`[${id}]: trying to resolve latest version...`);
|
|
60
|
-
const { extensions } = await client.query({ extensionId: id, includeAllVersions: true });
|
|
53
|
+
const { extensions } = await client.query({ extensionId: id.id, includeAllVersions: true });
|
|
61
54
|
extension = this.vsxApiFilter.getLatestCompatibleExtension(extensions);
|
|
62
55
|
}
|
|
63
56
|
if (!extension) {
|
|
@@ -66,11 +59,11 @@ let VSXExtensionResolver = VSXExtensionResolver_1 = class VSXExtensionResolver {
|
|
|
66
59
|
if (extension.error) {
|
|
67
60
|
throw new Error(extension.error);
|
|
68
61
|
}
|
|
69
|
-
const resolvedId = id + '-' + extension.version;
|
|
62
|
+
const resolvedId = id.id + '-' + extension.version;
|
|
70
63
|
const downloadUrl = extension.files.download;
|
|
71
|
-
console.log(`[${id}]: resolved to '${resolvedId}'`);
|
|
64
|
+
console.log(`[${id.id}]: resolved to '${resolvedId}'`);
|
|
72
65
|
if (!(options === null || options === void 0 ? void 0 : options.ignoreOtherVersions)) {
|
|
73
|
-
const existingVersion = this.hasSameOrNewerVersion(id, extension);
|
|
66
|
+
const existingVersion = this.hasSameOrNewerVersion(id.id, extension);
|
|
74
67
|
if (existingVersion) {
|
|
75
68
|
console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
|
|
76
69
|
return;
|
|
@@ -124,31 +117,31 @@ let VSXExtensionResolver = VSXExtensionResolver_1 = class VSXExtensionResolver {
|
|
|
124
117
|
}
|
|
125
118
|
};
|
|
126
119
|
VSXExtensionResolver.TEMP_DIR_PREFIX = 'vscode-download';
|
|
127
|
-
__decorate([
|
|
120
|
+
(0, tslib_1.__decorate)([
|
|
128
121
|
(0, inversify_1.inject)(ovsx_client_provider_1.OVSXClientProvider),
|
|
129
|
-
__metadata("design:type", Function)
|
|
122
|
+
(0, tslib_1.__metadata)("design:type", Function)
|
|
130
123
|
], VSXExtensionResolver.prototype, "clientProvider", void 0);
|
|
131
|
-
__decorate([
|
|
124
|
+
(0, tslib_1.__decorate)([
|
|
132
125
|
(0, inversify_1.inject)(plugin_protocol_1.PluginDeployerHandler),
|
|
133
|
-
__metadata("design:type", Object)
|
|
126
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
134
127
|
], VSXExtensionResolver.prototype, "pluginDeployerHandler", void 0);
|
|
135
|
-
__decorate([
|
|
128
|
+
(0, tslib_1.__decorate)([
|
|
136
129
|
(0, inversify_1.inject)(request_1.RequestService),
|
|
137
|
-
__metadata("design:type", Object)
|
|
130
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
138
131
|
], VSXExtensionResolver.prototype, "requestService", void 0);
|
|
139
|
-
__decorate([
|
|
132
|
+
(0, tslib_1.__decorate)([
|
|
140
133
|
(0, inversify_1.inject)(plugin_vscode_environment_1.PluginVSCodeEnvironment),
|
|
141
|
-
__metadata("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
134
|
+
(0, tslib_1.__metadata)("design:type", plugin_vscode_environment_1.PluginVSCodeEnvironment)
|
|
142
135
|
], VSXExtensionResolver.prototype, "environment", void 0);
|
|
143
|
-
__decorate([
|
|
136
|
+
(0, tslib_1.__decorate)([
|
|
144
137
|
(0, inversify_1.inject)(plugin_uninstallation_manager_1.PluginUninstallationManager),
|
|
145
|
-
__metadata("design:type", plugin_uninstallation_manager_1.PluginUninstallationManager)
|
|
138
|
+
(0, tslib_1.__metadata)("design:type", plugin_uninstallation_manager_1.PluginUninstallationManager)
|
|
146
139
|
], VSXExtensionResolver.prototype, "uninstallationManager", void 0);
|
|
147
|
-
__decorate([
|
|
140
|
+
(0, tslib_1.__decorate)([
|
|
148
141
|
(0, inversify_1.inject)(ovsx_client_1.OVSXApiFilter),
|
|
149
|
-
__metadata("design:type", Object)
|
|
142
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
150
143
|
], VSXExtensionResolver.prototype, "vsxApiFilter", void 0);
|
|
151
|
-
VSXExtensionResolver = VSXExtensionResolver_1 = __decorate([
|
|
144
|
+
VSXExtensionResolver = VSXExtensionResolver_1 = (0, tslib_1.__decorate)([
|
|
152
145
|
(0, inversify_1.injectable)()
|
|
153
146
|
], VSXExtensionResolver);
|
|
154
147
|
exports.VSXExtensionResolver = VSXExtensionResolver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vsx-extension-resolver.js","sourceRoot":"","sources":["../../src/node/vsx-extension-resolver.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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
|
|
1
|
+
{"version":3,"file":"vsx-extension-resolver.js","sourceRoot":"","sources":["../../src/node/vsx-extension-resolver.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,6BAA6B;AAC7B,iCAAiC;AACjC,kDAAkD;AAClD,4DAAkE;AAClE,oDAA6C;AAC7C,kFAAoL;AACpL,+CAA+C;AAC/C,6FAA2F;AAC3F,yEAAoE;AACpE,oDAAoE;AACpE,+DAAmE;AACnE,6GAAwG;AACxG,iHAA4G;AAG5G,IAAa,oBAAoB,4BAAjC,MAAa,oBAAoB;IAS7B,MAAM,CAAC,QAAgB;QACnB,OAAO,CAAC,CAAC,sCAAkB,CAAC,IAAI,CAAC,IA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C,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;QACxE,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE;YAChC,OAAO,KAAK,CAAC;SAChB;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;SAC9E;aAAM;YACH,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ,CAAA;AAjFmB,oCAAe,GAAG,iBAAkB,CAAA;AAXxB;IAA3B,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;4DAA8C;AAC1C;IAA9B,IAAA,kBAAM,EAAC,uCAAqB,CAAC;;mEAAwD;AAC9D;IAAvB,IAAA,kBAAM,EAAC,wBAAc,CAAC;;4DAA0C;AAChC;IAAhC,IAAA,kBAAM,EAAC,mDAAuB,CAAC;2CAAiC,mDAAuB;yDAAC;AACpD;IAApC,IAAA,kBAAM,EAAC,2DAA2B,CAAC;2CAA2C,2DAA2B;mEAAC;AACpF;IAAtB,IAAA,kBAAM,EAAC,2BAAa,CAAC;;0DAAuC;AAPpD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA8FhC;AA9FY,oDAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vsx-registry-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/vsx-registry-backend-module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;
|
|
1
|
+
{"version":3,"file":"vsx-registry-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/vsx-registry-backend-module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAQ/D,wBAWG"}
|
|
@@ -23,6 +23,7 @@ const vsx_environment_1 = require("../common/vsx-environment");
|
|
|
23
23
|
const vsx_cli_1 = require("./vsx-cli");
|
|
24
24
|
const vsx_environment_impl_1 = require("./vsx-environment-impl");
|
|
25
25
|
const vsx_extension_resolver_1 = require("./vsx-extension-resolver");
|
|
26
|
+
const vsx_cli_deployer_participant_1 = require("./vsx-cli-deployer-participant");
|
|
26
27
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
28
|
bind(vsx_environment_1.VSXEnvironment).to(vsx_environment_impl_1.VSXEnvironmentImpl).inSingletonScope();
|
|
28
29
|
bind(vsx_cli_1.VsxCli).toSelf().inSingletonScope();
|
|
@@ -32,5 +33,7 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
32
33
|
.inSingletonScope();
|
|
33
34
|
bind(vsx_extension_resolver_1.VSXExtensionResolver).toSelf().inSingletonScope();
|
|
34
35
|
bind(plugin_protocol_1.PluginDeployerResolver).toService(vsx_extension_resolver_1.VSXExtensionResolver);
|
|
36
|
+
bind(vsx_cli_deployer_participant_1.VsxCliDeployerParticipant).toSelf().inSingletonScope();
|
|
37
|
+
bind(plugin_protocol_1.PluginDeployerParticipant).toService(vsx_cli_deployer_participant_1.VsxCliDeployerParticipant);
|
|
35
38
|
});
|
|
36
39
|
//# sourceMappingURL=vsx-registry-backend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vsx-registry-backend-module.js","sourceRoot":"","sources":["../../src/node/vsx-registry-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,sCAA0E;AAC1E,+CAAuD;AACvD,4DAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"vsx-registry-backend-module.js","sourceRoot":"","sources":["../../src/node/vsx-registry-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,sCAA0E;AAC1E,+CAAuD;AACvD,4DAA+D;AAC/D,kFAAiH;AACjH,+DAAiF;AACjF,uCAAmC;AACnC,iEAA4D;AAC5D,qEAAgE;AAChE,iFAA2E;AAE3E,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,gCAAc,CAAC,CAAC,EAAE,CAAC,yCAAkB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/D,IAAI,CAAC,gBAAM,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACzC,IAAI,CAAC,sBAAe,CAAC,CAAC,SAAS,CAAC,gBAAM,CAAC,CAAC;IACxC,IAAI,CAAC,wBAAiB,CAAC;SAClB,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,+BAAwB,CAAC,sCAAoB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC,CAAC;SAClH,gBAAgB,EAAE,CAAC;IACxB,IAAI,CAAC,6CAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,wCAAsB,CAAC,CAAC,SAAS,CAAC,6CAAoB,CAAC,CAAC;IAC7D,IAAI,CAAC,wDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,2CAAyB,CAAC,CAAC,SAAS,CAAC,wDAAyB,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/vsx-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "Theia - VSX Registry",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/filesystem": "1.
|
|
8
|
-
"@theia/
|
|
9
|
-
"@theia/
|
|
10
|
-
"@theia/plugin-ext
|
|
11
|
-
"@theia/
|
|
12
|
-
"@theia/
|
|
6
|
+
"@theia/core": "1.47.0",
|
|
7
|
+
"@theia/filesystem": "1.47.0",
|
|
8
|
+
"@theia/navigator": "1.47.0",
|
|
9
|
+
"@theia/ovsx-client": "1.47.0",
|
|
10
|
+
"@theia/plugin-ext": "1.47.0",
|
|
11
|
+
"@theia/plugin-ext-vscode": "1.47.0",
|
|
12
|
+
"@theia/preferences": "1.47.0",
|
|
13
|
+
"@theia/workspace": "1.47.0",
|
|
13
14
|
"luxon": "^2.4.0",
|
|
14
15
|
"p-debounce": "^2.1.0",
|
|
15
16
|
"semver": "^7.5.4",
|
|
16
|
-
"
|
|
17
|
+
"tslib": "^2.6.2"
|
|
17
18
|
},
|
|
18
19
|
"publishConfig": {
|
|
19
20
|
"access": "public"
|
|
@@ -53,11 +54,11 @@
|
|
|
53
54
|
"watch": "theiaext watch"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@theia/ext-scripts": "1.
|
|
57
|
+
"@theia/ext-scripts": "1.47.0",
|
|
57
58
|
"@types/luxon": "^2.3.2"
|
|
58
59
|
},
|
|
59
60
|
"nyc": {
|
|
60
61
|
"extends": "../../configs/nyc.json"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "96685e37b5450a599370355ccffd4062cf1b72ab"
|
|
63
64
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 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 { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { ArgumentProcessor } from '@theia/plugin-ext/lib/common/commands';
|
|
19
|
+
import { VSXExtension } from './vsx-extension';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class VsxExtensionArgumentProcessor implements ArgumentProcessor {
|
|
23
|
+
|
|
24
|
+
processArgument(arg: unknown): unknown {
|
|
25
|
+
if (arg instanceof VSXExtension) {
|
|
26
|
+
return arg.id;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return arg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -36,6 +36,11 @@ export namespace VSXExtensionsCommands {
|
|
|
36
36
|
label: nls.localizeByDefault('Install from VSIX') + '...',
|
|
37
37
|
dialogLabel: nls.localizeByDefault('Install from VSIX')
|
|
38
38
|
};
|
|
39
|
+
export const INSTALL_VSIX_FILE: Command = Command.toDefaultLocalizedCommand({
|
|
40
|
+
id: 'vsxExtensions.installVSIX',
|
|
41
|
+
label: 'Install Extension VSIX',
|
|
42
|
+
category: EXTENSIONS_CATEGORY,
|
|
43
|
+
});
|
|
39
44
|
export const INSTALL_ANOTHER_VERSION: Command = {
|
|
40
45
|
id: 'vsxExtensions.installAnotherVersion'
|
|
41
46
|
};
|
|
@@ -38,6 +38,7 @@ export const EXTENSIONS_CONTEXT_MENU: MenuPath = ['extensions_context_menu'];
|
|
|
38
38
|
export namespace VSXExtensionsContextMenu {
|
|
39
39
|
export const INSTALL = [...EXTENSIONS_CONTEXT_MENU, '1_install'];
|
|
40
40
|
export const COPY = [...EXTENSIONS_CONTEXT_MENU, '2_copy'];
|
|
41
|
+
export const CONTRIBUTION = [...EXTENSIONS_CONTEXT_MENU, '3_contribution'];
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
@injectable()
|
|
@@ -145,7 +146,7 @@ export class VSXExtension implements VSXExtensionData, TreeElement {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
get uri(): URI {
|
|
148
|
-
return VSCodeExtensionUri.
|
|
149
|
+
return VSCodeExtensionUri.fromId(this.id);
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
get id(): string {
|
|
@@ -495,6 +496,11 @@ export class VSXExtensionComponent<Props extends VSXExtensionComponent.Props = V
|
|
|
495
496
|
position: 'right'
|
|
496
497
|
});
|
|
497
498
|
}}
|
|
499
|
+
onMouseUp={event => {
|
|
500
|
+
if (event.button === 2) {
|
|
501
|
+
this.manage(event);
|
|
502
|
+
}
|
|
503
|
+
}}
|
|
498
504
|
>
|
|
499
505
|
{iconUrl ?
|
|
500
506
|
<img className='theia-vsx-extension-icon' src={iconUrl} /> :
|
|
@@ -14,29 +14,32 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import debounce = require('@theia/core/shared/lodash.debounce');
|
|
20
|
-
import { Command, CommandRegistry } from '@theia/core/lib/common/command';
|
|
21
|
-
import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
22
|
-
import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
|
|
23
|
-
import { VSXExtensionsModel } from './vsx-extensions-model';
|
|
17
|
+
import { CommonMenus, LabelProvider, PreferenceService, QuickInputService, QuickPickItem } from '@theia/core/lib/browser';
|
|
18
|
+
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
|
24
19
|
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
25
20
|
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
26
|
-
import { Color } from '@theia/core/lib/common/color';
|
|
27
21
|
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
|
|
28
22
|
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
29
|
-
import {
|
|
23
|
+
import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
24
|
+
import { CompoundMenuNodeRole, MenuModelRegistry, MessageService, SelectionService, nls } from '@theia/core/lib/common';
|
|
25
|
+
import { Color } from '@theia/core/lib/common/color';
|
|
26
|
+
import { Command, CommandRegistry } from '@theia/core/lib/common/command';
|
|
27
|
+
import URI from '@theia/core/lib/common/uri';
|
|
28
|
+
import { UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
|
|
29
|
+
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
30
30
|
import { FileDialogService, OpenFileDialogProps } from '@theia/filesystem/lib/browser';
|
|
31
|
-
import {
|
|
31
|
+
import { NAVIGATOR_CONTEXT_MENU } from '@theia/navigator/lib/browser/navigator-contribution';
|
|
32
|
+
import { OVSXApiFilter, VSXExtensionRaw } from '@theia/ovsx-client';
|
|
32
33
|
import { VscodeCommands } from '@theia/plugin-ext-vscode/lib/browser/plugin-vscode-commands-contribution';
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { BUILTIN_QUERY, INSTALLED_QUERY, RECOMMENDED_QUERY } from './vsx-extensions-search-model';
|
|
34
|
+
import { DateTime } from 'luxon';
|
|
35
|
+
import { OVSXClientProvider } from '../common/ovsx-client-provider';
|
|
36
36
|
import { IGNORE_RECOMMENDATIONS_ID } from './recommended-extensions/recommended-extensions-preference-contribution';
|
|
37
|
+
import { VSXExtension, VSXExtensionsContextMenu } from './vsx-extension';
|
|
37
38
|
import { VSXExtensionsCommands } from './vsx-extension-commands';
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
39
|
+
import { VSXExtensionsModel } from './vsx-extensions-model';
|
|
40
|
+
import { BUILTIN_QUERY, INSTALLED_QUERY, RECOMMENDED_QUERY } from './vsx-extensions-search-model';
|
|
41
|
+
import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
|
|
42
|
+
import debounce = require('@theia/core/shared/lodash.debounce');
|
|
40
43
|
|
|
41
44
|
export namespace VSXCommands {
|
|
42
45
|
export const TOGGLE_EXTENSIONS: Command = {
|
|
@@ -57,6 +60,7 @@ export class VSXExtensionsContribution extends AbstractViewContribution<VSXExten
|
|
|
57
60
|
@inject(OVSXClientProvider) protected clientProvider: OVSXClientProvider;
|
|
58
61
|
@inject(OVSXApiFilter) protected vsxApiFilter: OVSXApiFilter;
|
|
59
62
|
@inject(QuickInputService) protected quickInput: QuickInputService;
|
|
63
|
+
@inject(SelectionService) protected readonly selectionService: SelectionService;
|
|
60
64
|
|
|
61
65
|
constructor() {
|
|
62
66
|
super({
|
|
@@ -95,6 +99,13 @@ export class VSXExtensionsContribution extends AbstractViewContribution<VSXExten
|
|
|
95
99
|
execute: () => this.installFromVSIX()
|
|
96
100
|
});
|
|
97
101
|
|
|
102
|
+
commands.registerCommand(VSXExtensionsCommands.INSTALL_VSIX_FILE,
|
|
103
|
+
UriAwareCommandHandler.MonoSelect(this.selectionService, {
|
|
104
|
+
execute: fileURI => this.installVsixFile(fileURI),
|
|
105
|
+
isEnabled: fileURI => fileURI.scheme === 'file' && fileURI.path.ext === '.vsix'
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
|
|
98
109
|
commands.registerCommand(VSXExtensionsCommands.INSTALL_ANOTHER_VERSION, {
|
|
99
110
|
// Check downloadUrl to ensure we have an idea of where to look for other versions.
|
|
100
111
|
isEnabled: (extension: VSXExtension) => !extension.builtin && !!extension.downloadUrl,
|
|
@@ -143,6 +154,15 @@ export class VSXExtensionsContribution extends AbstractViewContribution<VSXExten
|
|
|
143
154
|
commandId: VSXExtensionsCommands.INSTALL_ANOTHER_VERSION.id,
|
|
144
155
|
label: nls.localizeByDefault('Install Another Version...'),
|
|
145
156
|
});
|
|
157
|
+
menus.registerMenuAction(NAVIGATOR_CONTEXT_MENU, {
|
|
158
|
+
commandId: VSXExtensionsCommands.INSTALL_VSIX_FILE.id,
|
|
159
|
+
label: VSXExtensionsCommands.INSTALL_VSIX_FILE.label,
|
|
160
|
+
when: 'resourceScheme == file && resourceExtname == .vsix'
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
menus.registerSubmenu(VSXExtensionsContextMenu.CONTRIBUTION, '', {
|
|
164
|
+
role: CompoundMenuNodeRole.Group,
|
|
165
|
+
});
|
|
146
166
|
}
|
|
147
167
|
|
|
148
168
|
registerColors(colors: ColorRegistry): void {
|
|
@@ -199,25 +219,37 @@ export class VSXExtensionsContribution extends AbstractViewContribution<VSXExten
|
|
|
199
219
|
title: VSXExtensionsCommands.INSTALL_FROM_VSIX.dialogLabel,
|
|
200
220
|
openLabel: nls.localizeByDefault('Install from VSIX'),
|
|
201
221
|
filters: { 'VSIX Extensions (*.vsix)': ['vsix'] },
|
|
202
|
-
canSelectMany: false
|
|
222
|
+
canSelectMany: false,
|
|
223
|
+
canSelectFiles: true
|
|
203
224
|
};
|
|
204
225
|
const extensionUri = await this.fileDialogService.showOpenDialog(props);
|
|
205
226
|
if (extensionUri) {
|
|
206
227
|
if (extensionUri.path.ext === '.vsix') {
|
|
207
|
-
|
|
208
|
-
try {
|
|
209
|
-
await this.commandRegistry.executeCommand(VscodeCommands.INSTALL_FROM_VSIX.id, extensionUri);
|
|
210
|
-
this.messageService.info(nls.localizeByDefault('Completed installing {0} extension from VSIX.', extensionName));
|
|
211
|
-
} catch (e) {
|
|
212
|
-
this.messageService.error(nls.localize('theia/vsx-registry/failedInstallingVSIX', 'Failed to install {0} from VSIX.', extensionName));
|
|
213
|
-
console.warn(e);
|
|
214
|
-
}
|
|
228
|
+
await this.installVsixFile(extensionUri);
|
|
215
229
|
} else {
|
|
216
230
|
this.messageService.error(nls.localize('theia/vsx-registry/invalidVSIX', 'The selected file is not a valid "*.vsix" plugin.'));
|
|
217
231
|
}
|
|
218
232
|
}
|
|
219
233
|
}
|
|
220
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Installs a local vs-code extension file.
|
|
237
|
+
* The implementation doesn't check if the file is a valid VSIX file, or the URI has a *.vsix extension.
|
|
238
|
+
* The caller should ensure the file is a valid VSIX file.
|
|
239
|
+
*
|
|
240
|
+
* @param fileURI the URI of the file to install.
|
|
241
|
+
*/
|
|
242
|
+
protected async installVsixFile(fileURI: URI): Promise<void> {
|
|
243
|
+
const extensionName = this.labelProvider.getName(fileURI);
|
|
244
|
+
try {
|
|
245
|
+
await this.commandRegistry.executeCommand(VscodeCommands.INSTALL_FROM_VSIX.id, fileURI);
|
|
246
|
+
this.messageService.info(nls.localizeByDefault('Completed installing {0} extension from VSIX.', extensionName));
|
|
247
|
+
} catch (e) {
|
|
248
|
+
this.messageService.error(nls.localize('theia/vsx-registry/failedInstallingVSIX', 'Failed to install {0} from VSIX.', extensionName));
|
|
249
|
+
console.warn(e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
221
253
|
/**
|
|
222
254
|
* Given an extension, displays a quick pick of other compatible versions and installs the selected version.
|
|
223
255
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, interfaces, postConstruct, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { TreeModel, TreeNode } from '@theia/core/lib/browser';
|
|
18
|
+
import { Message, TreeModel, TreeNode } from '@theia/core/lib/browser';
|
|
19
19
|
import { SourceTreeWidget } from '@theia/core/lib/browser/source-tree';
|
|
20
20
|
import { VSXExtensionsSource, VSXExtensionsSourceOptions } from './vsx-extensions-source';
|
|
21
21
|
import { nls } from '@theia/core/lib/common/nls';
|
|
@@ -153,4 +153,13 @@ export class VSXExtensionsWidget extends SourceTreeWidget implements BadgeWidget
|
|
|
153
153
|
}
|
|
154
154
|
return super.renderTree(model);
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
protected override onAfterShow(msg: Message): void {
|
|
158
|
+
super.onAfterShow(msg);
|
|
159
|
+
if (this.options.id === VSXExtensionsSourceOptions.INSTALLED) {
|
|
160
|
+
// This is needed when an Extension was installed outside of the extension view.
|
|
161
|
+
// E.g. using explorer context menu.
|
|
162
|
+
this.doUpdateRows();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
156
165
|
}
|
|
@@ -72,7 +72,7 @@ export class VSXLanguageQuickPickService extends LanguageQuickPickService {
|
|
|
72
72
|
localizationContribution.localizedLanguageName ?? localizationContribution.languageName ?? localizationContribution.languageId),
|
|
73
73
|
});
|
|
74
74
|
try {
|
|
75
|
-
const extensionUri = VSCodeExtensionUri.
|
|
75
|
+
const extensionUri = VSCodeExtensionUri.fromId(extension.extension.name, extension.extension.namespace).toString();
|
|
76
76
|
await this.pluginServer.deploy(extensionUri);
|
|
77
77
|
} finally {
|
|
78
78
|
progress.cancel();
|
|
@@ -37,6 +37,8 @@ import { bindVsxExtensionsPreferences } from './vsx-extensions-preferences';
|
|
|
37
37
|
import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
|
|
38
38
|
import { LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
|
|
39
39
|
import { VSXLanguageQuickPickService } from './vsx-language-quick-pick-service';
|
|
40
|
+
import { VsxExtensionArgumentProcessor } from './vsx-extension-argument-processor';
|
|
41
|
+
import { ArgumentProcessorContribution } from '@theia/plugin-ext/lib/main/browser/command-registry-main';
|
|
40
42
|
|
|
41
43
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
42
44
|
bind(VSXEnvironment)
|
|
@@ -105,4 +107,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
105
107
|
bindExtensionPreferences(bind);
|
|
106
108
|
bindPreferenceProviderOverrides(bind, unbind);
|
|
107
109
|
bindVsxExtensionsPreferences(bind);
|
|
110
|
+
|
|
111
|
+
bind(VsxExtensionArgumentProcessor).toSelf().inSingletonScope();
|
|
112
|
+
bind(ArgumentProcessorContribution).toService(VsxExtensionArgumentProcessor);
|
|
108
113
|
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 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 { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { PluginDeployerParticipant, PluginDeployerStartContext } from '@theia/plugin-ext';
|
|
19
|
+
import { VsxCli } from './vsx-cli';
|
|
20
|
+
import { VSXExtensionUri } from '../common';
|
|
21
|
+
import * as fs from 'fs';
|
|
22
|
+
import { FileUri } from '@theia/core/lib/node';
|
|
23
|
+
import * as path from 'path';
|
|
24
|
+
|
|
25
|
+
@injectable()
|
|
26
|
+
export class VsxCliDeployerParticipant implements PluginDeployerParticipant {
|
|
27
|
+
|
|
28
|
+
@inject(VsxCli)
|
|
29
|
+
protected readonly vsxCli: VsxCli;
|
|
30
|
+
|
|
31
|
+
async onWillStart(context: PluginDeployerStartContext): Promise<void> {
|
|
32
|
+
const pluginUris = this.vsxCli.pluginsToInstall.map(async id => {
|
|
33
|
+
try {
|
|
34
|
+
const resolvedPath = path.resolve(id);
|
|
35
|
+
const stat = await fs.promises.stat(resolvedPath);
|
|
36
|
+
if (stat.isFile()) {
|
|
37
|
+
return FileUri.create(resolvedPath).withScheme('local-file').toString();
|
|
38
|
+
}
|
|
39
|
+
} catch (e) {
|
|
40
|
+
// expected if file does not exist
|
|
41
|
+
}
|
|
42
|
+
return VSXExtensionUri.fromVersionedId(id).toString();
|
|
43
|
+
});
|
|
44
|
+
context.userEntries.push(...await Promise.all(pluginUris));
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/node/vsx-cli.ts
CHANGED
|
@@ -24,9 +24,15 @@ import * as fs from 'fs';
|
|
|
24
24
|
export class VsxCli implements CliContribution {
|
|
25
25
|
|
|
26
26
|
ovsxRouterConfig: OVSXRouterConfig | undefined;
|
|
27
|
+
pluginsToInstall: string[] = [];
|
|
27
28
|
|
|
28
29
|
configure(conf: Argv<{}>): void {
|
|
29
30
|
conf.option('ovsx-router-config', { description: 'JSON configuration file for the OVSX router client', type: 'string' });
|
|
31
|
+
conf.option('install-plugin', {
|
|
32
|
+
alias: 'install-extension',
|
|
33
|
+
nargs: 1,
|
|
34
|
+
desc: 'Installs or updates a plugin. Argument is a path to the *.vsix file or a plugin id of the form "publisher.name[@version]"'
|
|
35
|
+
});
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
async setArguments(args: Record<string, unknown>): Promise<void> {
|
|
@@ -34,5 +40,12 @@ export class VsxCli implements CliContribution {
|
|
|
34
40
|
if (typeof ovsxRouterConfig === 'string') {
|
|
35
41
|
this.ovsxRouterConfig = JSON.parse(await fs.promises.readFile(ovsxRouterConfig, 'utf8'));
|
|
36
42
|
}
|
|
43
|
+
let pluginsToInstall = args.installPlugin;
|
|
44
|
+
if (typeof pluginsToInstall === 'string') {
|
|
45
|
+
pluginsToInstall = [pluginsToInstall];
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(pluginsToInstall)) {
|
|
48
|
+
this.pluginsToInstall = pluginsToInstall;
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
}
|
|
@@ -51,13 +51,14 @@ export class VSXExtensionResolver implements PluginDeployerResolver {
|
|
|
51
51
|
}
|
|
52
52
|
let extension: VSXExtensionRaw | undefined;
|
|
53
53
|
const client = await this.clientProvider();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const version = options?.version || id.version;
|
|
55
|
+
if (version) {
|
|
56
|
+
console.log(`[${id}]: trying to resolve version ${version}...`);
|
|
57
|
+
const { extensions } = await client.query({ extensionId: id.id, extensionVersion: version, includeAllVersions: true });
|
|
57
58
|
extension = extensions[0];
|
|
58
59
|
} else {
|
|
59
60
|
console.log(`[${id}]: trying to resolve latest version...`);
|
|
60
|
-
const { extensions } = await client.query({ extensionId: id, includeAllVersions: true });
|
|
61
|
+
const { extensions } = await client.query({ extensionId: id.id, includeAllVersions: true });
|
|
61
62
|
extension = this.vsxApiFilter.getLatestCompatibleExtension(extensions);
|
|
62
63
|
}
|
|
63
64
|
if (!extension) {
|
|
@@ -66,12 +67,12 @@ export class VSXExtensionResolver implements PluginDeployerResolver {
|
|
|
66
67
|
if (extension.error) {
|
|
67
68
|
throw new Error(extension.error);
|
|
68
69
|
}
|
|
69
|
-
const resolvedId = id + '-' + extension.version;
|
|
70
|
+
const resolvedId = id.id + '-' + extension.version;
|
|
70
71
|
const downloadUrl = extension.files.download;
|
|
71
|
-
console.log(`[${id}]: resolved to '${resolvedId}'`);
|
|
72
|
+
console.log(`[${id.id}]: resolved to '${resolvedId}'`);
|
|
72
73
|
|
|
73
74
|
if (!options?.ignoreOtherVersions) {
|
|
74
|
-
const existingVersion = this.hasSameOrNewerVersion(id, extension);
|
|
75
|
+
const existingVersion = this.hasSameOrNewerVersion(id.id, extension);
|
|
75
76
|
if (existingVersion) {
|
|
76
77
|
console.log(`[${id}]: is already installed with the same or newer version '${existingVersion}'`);
|
|
77
78
|
return;
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core';
|
|
18
18
|
import { CliContribution } from '@theia/core/lib/node';
|
|
19
19
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
20
|
-
import { PluginDeployerResolver } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
20
|
+
import { PluginDeployerParticipant, PluginDeployerResolver } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
21
21
|
import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
|
|
22
22
|
import { VsxCli } from './vsx-cli';
|
|
23
23
|
import { VSXEnvironmentImpl } from './vsx-environment-impl';
|
|
24
24
|
import { VSXExtensionResolver } from './vsx-extension-resolver';
|
|
25
|
+
import { VsxCliDeployerParticipant } from './vsx-cli-deployer-participant';
|
|
25
26
|
|
|
26
27
|
export default new ContainerModule(bind => {
|
|
27
28
|
bind(VSXEnvironment).to(VSXEnvironmentImpl).inSingletonScope();
|
|
@@ -32,4 +33,6 @@ export default new ContainerModule(bind => {
|
|
|
32
33
|
.inSingletonScope();
|
|
33
34
|
bind(VSXExtensionResolver).toSelf().inSingletonScope();
|
|
34
35
|
bind(PluginDeployerResolver).toService(VSXExtensionResolver);
|
|
36
|
+
bind(VsxCliDeployerParticipant).toSelf().inSingletonScope();
|
|
37
|
+
bind(PluginDeployerParticipant).toService(VsxCliDeployerParticipant);
|
|
35
38
|
});
|