Skip to content

Commit

Permalink
Allow installation of VS Code extension packs
Browse files Browse the repository at this point in the history
Fixes #6611

- added `extensionPack` property to `PluginPackage` interface.
- when getting dependencies, ensure that `extensionPack` dependencies
are also loaded. Extensions packs can now be unloaded and their bundled
extensions installed.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Dec 3, 2019
1 parent b76f08e commit 79814b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/plugin-ext-vscode/src/node/scanner-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,23 @@ export class VsCodePluginScanner extends TheiaPluginScanner implements PluginSca
* Maps extension dependencies to deployable extension dependencies.
*/
getDependencies(plugin: PluginPackage): Map<string, string> | undefined {
if (!plugin.extensionDependencies || !plugin.extensionDependencies.length) {
// Store the list of dependencies.
const dependencies = new Map<string, string>();
// Store the list of available dependencies (`extensionDependencies` and `extensionPack`).
const deps: string[] = [];
// Add the list of `extensionDependencies` if available.
if (plugin.extensionDependencies && plugin.extensionDependencies.length) {
deps.push(...plugin.extensionDependencies);
}
// Add the list of `extensionPack` if available.
if (plugin.extensionPack && plugin.extensionPack.length) {
deps.push(...plugin.extensionPack);
}
// Exit early if no dependencies are present.
if (!deps.length) {
return undefined;
}
const dependencies = new Map<string, string>();
for (const dependency of plugin.extensionDependencies) {
for (const dependency of deps) {
const dependencyId = dependency.toLowerCase();
dependencies.set(dependencyId, this.VSCODE_PREFIX + dependencyId);
}
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-ext/src/common/plugin-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface PluginPackage {
packagePath: string;
activationEvents?: string[];
extensionDependencies?: string[];
extensionPack?: string[];
}
export namespace PluginPackage {
export function toPluginUrl(pck: PluginPackage, relativePath: string): string {
Expand Down

0 comments on commit 79814b7

Please sign in to comment.