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

[Electron] Plugins icons not showed on Electron #7040

Closed
lmcbout opened this issue Jan 31, 2020 · 7 comments
Closed

[Electron] Plugins icons not showed on Electron #7040

lmcbout opened this issue Jan 31, 2020 · 7 comments
Labels
bug bugs found in the application electron issues related to the electron target help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility

Comments

@lmcbout
Copy link
Contributor

lmcbout commented Jan 31, 2020

Description

On Electron, some icons are not shown when the plugins is installed.
May be related to #6834

Reproduction Steps

To test, install gitlens plugins and select View-> Gitlens
You will see the views, but no icon on the sidebar. (Look on the left side panel)
Tested with electron on Ubuntu 16.04 and plugin:gitlens-10.2.0.vsix
Note: If you run the same GitLens plugins on a browser (Chrome), the icon is displayed on the sidebar.

OS and Theia version:
Theia: latest (0.15.0)
OS: Ubuntu 16.04

Diagnostics:
Electron:
GitLensElectron

Browser:
GitLensBrowser

@vince-fugnitto vince-fugnitto added electron issues related to the electron target vscode issues related to VSCode compatibility labels Jan 31, 2020
@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help labels Jan 31, 2020
@Johannes-B-stock
Copy link

It looks like we might have the same issue. In the DevTool it shows that instead of looking for the icons in the plugins folder, the extensionContext path leads to a asar-packed path which cant be resolved.
The path looks something like app.asar/lib/hostedPlugin/plugin-name/*

@vince-fugnitto
Copy link
Member

@akosyakov @kittaakos do you happen to have an idea as to why the assets are not properly displayed in electron? I suspect it's the same reason that #6834 does not work properly.
I thought it might have to do with how we webpack the resources.

@akosyakov
Copy link
Member

@vince-fugnitto no, one has to debug why such paths are generated

@Johannes-B-stock
Copy link

We found a workaround. Apparently the pluginUrl needs to be an absolute path when running in Electron and a relative when running in the browser.
We fixed it by changing the function toPluginUrl() in plugin-ext/common/plugin-protocol.ts to return the absolute path "file:///" + path.join(pck.packagePath, relativePath).replace(/\\/g, "/"); when the extension is running in Electron.

@vince-fugnitto
Copy link
Member

We found a workaround. Apparently the pluginUrl needs to be an absolute path when running in Electron and a relative when running in the browser.
We fixed it by changing the function toPluginUrl() in plugin-ext/common/plugin-protocol.ts to return the absolute path "file:///" + path.join(pck.packagePath, relativePath).replace(/\\/g, "/"); when the extension is running in Electron.

Would you like to propose your changes in a pull-request? We can add a check to determine if the target is Electron and compute the path accordingly.

@Johannes-B-stock
Copy link

Will take care

Livven pushed a commit to siemens/theia that referenced this issue Feb 24, 2020
Fixes eclipse-theia#7040.

Signed-off-by: Johannes Birkenstock <johannes.birkenstock@siemens.com>
Signed-off-by: Liwen Guo <liwen.guo@siemens.com>
Livven pushed a commit to siemens/theia that referenced this issue Feb 25, 2020
Fixes eclipse-theia#7040.

Signed-off-by: Johannes Birkenstock <johannes.birkenstock@siemens.com>
Signed-off-by: Liwen Guo <liwen.guo@siemens.com>
Livven pushed a commit to siemens/theia that referenced this issue Mar 4, 2020
Fixes eclipse-theia#7040.

Signed-off-by: Johannes Birkenstock <johannes.birkenstock@siemens.com>
Signed-off-by: Liwen Guo <liwen.guo@siemens.com>
Signed-off-by: Liwen Guo <lg@livven.me>
Livven pushed a commit to siemens/theia that referenced this issue Mar 4, 2020
Fixes eclipse-theia#7040.

Signed-off-by: Johannes Birkenstock <johannes.birkenstock@siemens.com>
Signed-off-by: Liwen Guo <liwen.guo@siemens.com>
@vince-fugnitto
Copy link
Member

Closed by #7583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application electron issues related to the electron target help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants