Skip to content

Commit 2860190

Browse files
committed
plugin-ext-vscode: apply file handlers only for user plugins
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 <[email protected]>
1 parent a87c46a commit 2860190

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/plugin-ext/src/main/node/plugin-deployer-impl.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,20 @@ export class PluginDeployerImpl implements PluginDeployer {
225225
}
226226

227227
protected async resolveAndHandle(id: string, type: PluginType, options?: PluginDeployOptions): Promise<PluginDeployerEntry[]> {
228-
const entries = await this.resolvePlugin(id, type, options);
229-
await this.applyFileHandlers(entries);
228+
let entries = await this.resolvePlugin(id, type, options);
229+
if (type === PluginType.User) {
230+
await this.applyFileHandlers(entries);
231+
} else {
232+
const filteredEntries: PluginDeployerEntry[] = [];
233+
for (const entry of entries) {
234+
if (await entry.isFile()) {
235+
this.logger.warn(`Only user plugins will be handled by file handlers, please unpack the plugin '${entry.id()}' manually.`);
236+
} else {
237+
filteredEntries.push(entry);
238+
}
239+
}
240+
entries = filteredEntries;
241+
}
230242
await this.applyDirectoryFileHandlers(entries);
231243
return entries;
232244
}

0 commit comments

Comments
 (0)