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

Re-implement core of which-key #53

Closed stevenguh closed 2 years ago

stevenguh commented 2 years ago

Fix #38, #51.

This pull request contains a rewrite of the core of which-key to

Tests performed:

Manual tests

Race condition

  1. On Linux, sleep 1; xdotool type " "; sleep 0.001; xdotool type "mx"
  2. Switch focus to VSCode on the markdown buffer
  3. The "+Text" for markdown is shown

Other smoke tests

@MarcoIeni Just wondering if you have some time to try it out and make sure I am not breaking anything major?

MarcoIeni commented 2 years ago

Sure, I will try to test this today

MarcoIeni commented 2 years ago

I followed the contributing guide on how to do the first setup. Then I used this usually by typing spc. I am testing the right thing or am I just testing normal VSpaceCode?

By the way:

Doubts: how do I test this?

Tested desc bind menu (C-h) Tested hide option via overrides

stevenguh commented 2 years ago

Then I used this usually by typing spc. I am testing the right thing or am I just testing normal VSpaceCode?

That should work, and should be using the new which key core.

Tested desc bind menu (C-h)

Press Control-h in any which key menu to launch the "Search binding" menu.

Tested hide option via overrides

Try adding a binding with "display": "hidden" in the override. That item will not be shown but can still be trigger by key.

For example: The blame shouldn't be shown in the UI of the <spc> g menu, but should still works with b key.

"vspacecode.bindingOverrides": [
        {
            "keys": "g.b",
            "name": "Blame",
            "type": "command",
            "display": "hidden",
            "command": "gitlens.toggleFileBlame"
        },
]
MarcoIeni commented 2 years ago

Both works fine for me!

stevenguh commented 2 years ago

Thanks Marco :)