Skip to content

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

@rachel-fenichel

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions