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

Redundant double debug registrations for plugins #10835

Closed
colin-grant-work opened this issue Mar 2, 2022 · 3 comments
Closed

Redundant double debug registrations for plugins #10835

colin-grant-work opened this issue Mar 2, 2022 · 3 comments
Labels
plug-in system issues related to the plug-in system quality issues related to code and application quality

Comments

@colin-grant-work
Copy link
Contributor

colin-grant-work commented Mar 2, 2022

Bug Description:

We register debuggers once in the contribution handler and once in the plugin context.

In the PluginDebugService, the first registration puts the contribution in the debuggers array and the second registration puts the contribution in the contributors map so that we end up with completely parallel lists, vz. the output of a log in the init method of the PluginDebugService that sets a timeout to log { debuggers: this.debuggers.map(contrib => contrib.type), contributors: Array.from(this.contributors.keys()) }:

{
  debuggers: [
    'extensionHost',
    'node2',
    'pwa-node',
    'node-terminal',
    'pwa-extensionHost',
    'pwa-chrome',
    'pwa-msedge',
    'node'
  ],
  contributors: [
    'extensionHost',
    'node2',
    'pwa-node',
    'node-terminal',
    'pwa-extensionHost',
    'pwa-chrome',
    'pwa-msedge',
    'node'
  ]
}

Additional Information

@colin-grant-work colin-grant-work added quality issues related to code and application quality plug-in system issues related to the plug-in system labels Mar 2, 2022
@alvsan09
Copy link
Contributor

alvsan09 commented Mar 7, 2022

@colin-grant-work, I am not quite able to follow the last part,
Could you please point me to the logging of the identical entries under the PluginDebugService?

The types for the contributors vs debuggers is different although I agree we should try to merge them if possible.

@colin-grant-work
Copy link
Contributor Author

@alvsan09, there isn't a log like the one I displayed in the current code. To generate it, I added this line to the init method:

setTimeout(() => console.log({ debuggers: this.debuggers.map(contrib => contrib.type), contributors: Array.from(this.contributors.keys()) }), 10_000);

They are indeed different types, but the condition for the two registrations is the same: the presence of a .contributes.debuggers field, so the registrations from the plugin context will always be a (not necessarily proper) subset of the registrations from the contribution handler. Perhaps the map is the correct approach, and then we can replace the registrations from the contribution handler (which are just data with no code), with the registrations from the plugin context (which have the same data, but also executable code attached) as the latter come in?

@colin-grant-work
Copy link
Contributor Author

Fixed by #10910.

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 quality issues related to code and application quality
Projects
None yet
Development

No branches or pull requests

2 participants