Skip to content

Commit

Permalink
fix: load vsix with no publisher
Browse files Browse the repository at this point in the history
This is relevant for extension development flow.
Currently when running 'yo code' the extension is created without publisher.
VS code 'Run Extension' launcher is able to run/debug it.
In theia prior to this fix it caused TypeError: Cannot read property 'toLowerCase' of undefined

Signed-off-by: Amiram Wingarten <amiram.wingarten@sap.com>
  • Loading branch information
amiramw committed Jul 20, 2020
1 parent e02ac48 commit ac06ac9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plugin-ext-vscode/src/node/scanner-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ export class VsCodePluginScanner extends TheiaPluginScanner implements PluginSca
}

getModel(plugin: PluginPackage): PluginModel {
// publisher can be empty on vscode extension development
const publisher = plugin.publisher || '';
const result: PluginModel = {
packagePath: plugin.packagePath,
packageUri: FileUri.create(plugin.packagePath).toString(),
// see id definition: https://github.com/microsoft/vscode/blob/15916055fe0cb9411a5f36119b3b012458fe0a1d/src/vs/platform/extensions/common/extensions.ts#L167-L169
id: `${plugin.publisher.toLowerCase()}.${plugin.name.toLowerCase()}`,
id: `${publisher.toLowerCase()}.${plugin.name.toLowerCase()}`,
name: plugin.name,
publisher: plugin.publisher,
publisher: publisher,
version: plugin.version,
displayName: plugin.displayName,
description: plugin.description,
Expand Down

0 comments on commit ac06ac9

Please sign in to comment.