-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
How to hide context menu commands from command palette? #45119
Comments
(Experimental duplicate detection) |
Yeah, that's the idea of global commands. Be prepared that your commands are invoked by whomever... You can use the when-trick but |
Please ask your question on StackOverflow. We have a great community over there. They have already answered thousands of questions and are happy to answer yours as well. See also our issue reporting guidelines. Happy Coding! |
@jrieken I don't quite understand what you mean. Do you mean to actually use the condition |
half and half.
That doesn't exist for us, every command is public and when-clauses are recommendations only, albeit very good recommendations. |
What about when there are arguments? (for ex. this one takes an argument that is a Let me know if there's a better way to do this! |
Doh - I had a copy/paste error. |
You need to always check them, ideally infer them when missing. We know that's hard... There are ideas about command-preconditions which will control the enablement state but we haven't narrowed down on it yet |
I'm contributing some commands to a custom view via
view/item/context
inpackages.json
, but they're showing up in the command palette. I had prefixed them with an_
and also set thewhen
condition inmenu/commandPalette
tofalse
however they still appear in the command palette:What's the correct way to hide an item from the palette (these commands are actions on a node in the contributed tree and don't make sense to execute without a node).
The text was updated successfully, but these errors were encountered: