Support args
for workbench.action.selectTheme
#100861
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #100460
This PR adds optional
args
support for theworkbench.action.selectTheme
command, allowing users to define keybindings that directly switch to a specified theme (instead of opening the theme picker).Such a keybinding can only be defined by directly editing
keybindings.json
because there is no GUI support forargs
.Some examples:
Values of the
id
field should match the"workbench.colorTheme"
setting insettings.json
. However theme's ids are not exposed anywhere in GUI, so users can only get them by switching to the desired theme, then copying from the"workbench.colorTheme"
setting (or checkingpackage.json
of the theme extension).A keybinding without
args
orargs.id
will continue opening the theme picker, without breaking existing use cases. A keybinding with invalidargs.id
will show an error when invoked.A side effect is that now the command palette may display one of the keybindings containing
args
asPreferences: Color Theme
command's shortcut (despite that invoking from command palette will always open the theme picker, while the displayed shortcut will directly switch to some theme). I have filed #100830 for it. But since that issue is categorized into "Backlog Candidates", I assume it's low priority and won't block this PR.