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

Plugin-ext only can use one plugin at the same time #9901

Closed
misakajimmy opened this issue Aug 13, 2021 · 2 comments · Fixed by #9902
Closed

Plugin-ext only can use one plugin at the same time #9901

misakajimmy opened this issue Aug 13, 2021 · 2 comments · Fixed by #9902
Labels
plug-in system issues related to the plug-in system

Comments

@misakajimmy
Copy link
Contributor

misakajimmy commented Aug 13, 2021

Bug Description:

Theia frontend plugin can start one at the same time.

Steps to Reproduce:

  1. Use yo generate two frontend hello-world example plugin in the same dir
  2. Start theia with --plugins=local-dir:path/to/dir
  3. Theia successful load two plugin but only one plugin Started plugin,the second plugin will be overwrited

There seems a bug here

https://github.com/eclipse-theia/theia/blob/master/packages/plugin-ext/src/hosted/browser/hosted-plugin.ts#:~:text=const%20host%20%3D%20plugin,set(host%2C%20dynamicContributions)%3B

                const host = plugin.model.entryPoint.frontend ? 'frontend' : plugin.host;
                const dynamicContributions = hostContributions.get(plugin.host) || [];
                dynamicContributions.push(contributions);
                hostContributions.set(host, dynamicContributions);

if two plugins all frontend plugins,at first plugin load host = "frontend", plugin.host = "main", dynamicContributions = hostContributions.get("main"),
but dynamicContributions which load from main will set to host which is frontend .
when load second plugin, dynamicContributions will load from main and it will lead to dynamicContributions = [], i think it should load from forntend,Otherwise first plugin will be overwrite

Additional Information

  • Theia Version: since 1.13.0
@vince-fugnitto
Copy link
Member

@misakajimmy I believe it is a duplicate of #9064, I'll close the other issue as you already attempted a fix 👍

@tsmaeder
Copy link
Contributor

@misakajimmy do you have an interesting use case for front-end plugins you could share?

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 a pull request may close this issue.

3 participants