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

Refactor MenuNode to get rid of MenuExecutor, MenuCommandAdapterRegistry and MenuCommandExecutor #14217

Open
tsmaeder opened this issue Sep 25, 2024 · 0 comments

Comments

@tsmaeder
Copy link
Contributor

Feature Description:

Currently menu nodes (whether they be sub-menus, groups, separators or actions) are pure data. users of the MenuNode interfaces must implement all concerns like whether a menu item is visible in a context or how to adapt menu command parameters (for example, converting Widget instances to a view id to send to a plugin) themselves. In order to prevent breaking layers, we have introduced a registry infrastructure (MenuCommandAdapterRegistry ) that allows in particular the VS Code contribution handlers to influence the execution and visibility of items in toolbars and menus.
By making menu nodes active and polymorphous (for example, replacing the command field with a run method), we could simplify the menu item handling and move the complexity to where it is needed and hide it from the rest of the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant