Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: load vsix with no publisher #8196

Merged
merged 1 commit into from
Jul 20, 2020
Merged

fix: load vsix with no publisher #8196

merged 1 commit into from
Jul 20, 2020

Conversation

amiramw
Copy link
Member

@amiramw amiramw commented Jul 19, 2020

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 [email protected]

What it does

Fix run hosted plugin flow when publisher is missing on the extension project selected.

How to test

  1. Run yarn global add yo generator-code
  2. Run yo code
  3. Run: F1 -> "Hosted Plugin: Start Instance"
  4. Select the project created
  5. Hosted plugin should now have command "Hello World" and running it create a user notification

Prior to that fix the extension could not be deployed on backend with this stack trace:

root ERROR Failed to load plugin metadata from "/workspace/test" TypeError: Cannot read property 'toLowerCase' of undefined
    at VsCodePluginScanner.getModel (/workspace/theia/packages/plugin-ext-vscode/lib/node/scanner-vscode.js:73:34)
    at MetadataScanner.getPluginMetadata (/workspace/theia/packages/plugin-ext/lib/hosted/node/metadata-scanner.js:46:28)
    at HostedPluginReader.readMetadata (/workspace/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:171:43)
    at HostedPluginReader.<anonymous> (/workspace/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:139:64)
    at step (/workspace/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:57:23)
    at Object.next (/workspace/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:38:53)
    at fulfilled (/workspace/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:29:58)

root ERROR Could not initialize contribution TypeError: Cannot read property 'model' of undefined
    at HostedPluginReader.<anonymous> (/workspace/theia/packages/plugin-dev/lib/node/hosted-plugin-reader.js:87:44)
    at step (/workspace/theia/packages/plugin-dev/lib/node/hosted-plugin-reader.js:57:23)
    at Object.next (/workspace/theia/packages/plugin-dev/lib/node/hosted-plugin-reader.js:38:53)
    at fulfilled (/workspace/theia/packages/plugin-dev/lib/node/hosted-plugin-reader.js:29:58)

Review checklist

Reminder for reviewers

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 <[email protected]>
Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@akosyakov akosyakov added the plug-in system issues related to the plug-in system label Jul 20, 2020
@amiramw amiramw merged commit ac06ac9 into master Jul 20, 2020
@amiramw amiramw deleted the toLower branch July 20, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants