VSpaceCode / vscode-which-key

which-key like menu for Visual Studio Code
https://vspacecode.github.io/docs/whichkey
MIT License
166 stars 18 forks source link

Support partial override #56

Open mly32 opened 2 years ago

mly32 commented 2 years ago

Problem

I would like to use the display: hidden options for focusing windows (space.1..9), but the way I'm currently doing it is this:

"vspacecode.bindingOverrides": [
  {
    "keys": "1",
    "name": "Focus 1st Window",
    "display": "hidden",
    "type": "command",
    "command": "workbench.action.focusFirstEditorGroup"
  },
  ....
],
...

Solution

Ideally, I'd just need to have:

"vspacecode.bindingOverrides": [
  { "keys": "1", "display": "hidden" },
]

without needing to redefine the entire keybinding.

Alternatives

Additional context

Not sure if this is an issue that goes belongs to which-key or spacecode... Maybe I'm also just using the flag wrong. Why does the documentation say this:

This type contains all the possible way to display a BindingItem or TransientBindingItem.

Does this mean the hidden option is not supported in OverrideBindingItem?

stevenguh commented 2 years ago

The idea in the solution sounds good to me.


This type contains all the possible way to display a BindingItem or TransientBindingItem.

Does this mean the hidden option is not supported in OverrideBindingItem?

It should work for OverrideBindingItem. Does display: "hidden" not work for you in OverrideBindingItem?

It was probably a miss in the documentation because we didn't have OverrideBindingItem in the type section I think.