[GetToCode] Adds noshellEnabled/noshellVisible in CommandCodon to disable items based in WelcomeScreen
This PR adds a new feature in CommandCodon to enable/disable menu items
Now we can add in the addon manigest
- noshellEnabled = "[true|false]"
- noshellVisible = "[true|false]"
and we'll disable/hidden menus when there is no shell (this is the WelcomeScreen mode)
This properties could be added to:
- Command (single or an array of items)
- Category
And in case of group the value will affect it's children.
Fixes VSTS #935559 - [Shell] Some menus should be disabled in only GTC mode
Disabling layout Command group
Disabling Debug category group
Why do we need this?
What commands should we actually have in GTC mode? Maybe we should actually conditionally add commands for when we only show GTC. As in, a whitelist, not a blacklist.
I feel we should just declare a different extension point into which we put commands which are visible without the Ide being there.
I agree with @Therzok, but I don't think that we need an additional extension point for this (would be cumbersome to maintain). A better approach would be a simple opt-in in CommandCodon.
Something like:
-
noshellEnabled = "[true|false]" -
noshellVisible = "[true|false]"
or we use one prop like noshell = "disabled|disabled-visible"
could look like this to opt in to show in disabled state:
<Command id = "MonoDevelop.Debugger.DebugCommands.DebugApplication"
noshellEnabled = "false"
noshellVisible = "true"
[...]
/>
Also I wouldn't delegate the logic to the command handlers, but do it all in CommandManager. If a command has no opt-in, it wouldn't run the update handler at all but just set the appropriate values in the CommandInfo (so they get picked up correctly by the menu logic).