Skip to content

Commit

Permalink
plugin-ext-vscode: apply file handlers only for user plugins (#13435)
Browse files Browse the repository at this point in the history
This patch fixes an unexpected behavior where Theia would also pick up
and deploy .vsix files from the local-plugins directory into the
deployedPlugins directory, where they will be treated as user-installed
extensions on the next start of theia.

Instead, we now only apply the file handlers for .vsix files if they are
user extensions. For system plugins, we print a warning message indicating
that the plugin has to be unpacked manually.

Fixes #13222

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
  • Loading branch information
xai authored Apr 24, 2024
1 parent 746f8ff commit 1578d2d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/plugin-ext/src/main/node/plugin-deployer-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,20 @@ export class PluginDeployerImpl implements PluginDeployer {
}

protected async resolveAndHandle(id: string, type: PluginType, options?: PluginDeployOptions): Promise<PluginDeployerEntry[]> {
const entries = await this.resolvePlugin(id, type, options);
await this.applyFileHandlers(entries);
let entries = await this.resolvePlugin(id, type, options);
if (type === PluginType.User) {
await this.applyFileHandlers(entries);
} else {
const filteredEntries: PluginDeployerEntry[] = [];
for (const entry of entries) {
if (await entry.isFile()) {
this.logger.warn(`Only user plugins will be handled by file handlers, please unpack the plugin '${entry.id()}' manually.`);
} else {
filteredEntries.push(entry);
}
}
entries = filteredEntries;
}
await this.applyDirectoryFileHandlers(entries);
return entries;
}
Expand Down

0 comments on commit 1578d2d

Please sign in to comment.