-
Notifications
You must be signed in to change notification settings - Fork 30k
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
API: Menu item enablement #21131
Comments
@jrieken Any thoughts on contributed menu items enablement? |
Yeah, there is no story for enablement yet. For now you make the when-clause more specific such that the menu item doesn't show. One idea could be to add an enablement-clause when defining a command. It could use the when-syntax but define enablement of a command. |
Renamed for clarity. |
It would be great to have this, so that the Open Changes button can be greyed out when there are no changes for the current file. |
cc @rebornix |
most work actually already happened via #41103, exposing this to extensions is the missing piece |
Idea would be to allow for a "contributes": {
"commands": [
{
"command": "someCommand",
"title": "My Some Command",
"precondition": "myContext == 42",
"category": "Something"
}, |
This happened via: #74017 |
@rebornix While revising #74017 I missed that enablement isn't a menu property but a command property. Commands should be enable/disabled independent of their UX location. I have pushed a change for this. After discussing we have also concluded that {
"command": "extension.sayHello1",
"title": "Hello Enablement",
"enablement": "editorHasSelection"
} |
This used to be like that in the old world I think.
The text was updated successfully, but these errors were encountered: