Skip to content

Export registry objects, not classes, from contextmenu registry and shortcut registry #5950

Description

@rachel-fenichel

Is your feature request related to a problem? Please describe.

Both the context menu registry and the shortcut registry export a class which has a static property, registry, which is the singleton that should be interacted with. This is confusing and makes it look like calling the constructor is a reasonable thing to do.

Describe the solution you'd like

Add exports:
exports.shortcutRegistry = ShortcutRegistry.registry and exports.contextMenuRegistry = ContextMenuRegistry.registry. Notice the lowercase first letters, to distinguish from exporting the class.

Remove the class exports.

Update related code and documentation.

Describe alternatives you've considered

Change the registries to be associated with workspaces, rather than a global singleton.

Additional context

I started to do the suggested change in #5940 (comment) but Maribeth pointed out that it was an API change in the middle of a refactor, so I backed it out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status
      Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions