VSpaceCode / vspacecode.github.io

VSpaceCode website
https://vspacecode.github.io
3 stars 23 forks source link

Cannot Redefine Keybindings on a per Workspace Basis #75

Closed erichlf closed 9 months ago

erichlf commented 9 months ago

Bug description

I am attempting to redefine <SPC> + p for a particular workspace, however the bindings that I have defined are not overriding the original bindings.

To Reproduce

  1. Open a workspace in VS Code.
  2. Add the following to .vscode/settings.json
    "vspacecode.bindingOverrides": [
        {
            "key": "p",
            "name": "+Project",
            "icon": "project",
            "type": "bindings",
            "bindings": [
                {
                    "key": "C",
                    "name": "Compile project",
                    "icon": "gear",
                    "type": "command",
                    "command": "workbench.action.tasks.build"
                }
            ]
                }
         ]
  3. Type <SPC> + p
  4. Witness that the menu has not changed.

Expected behavior

After the above steps I would expect that the menu would now only contain the "Compile project" command, but it contains all the default commands.

Additional context

We should be able to override keybindings on a per workspace basis by adding the keybindings to .vscode/settings.json.

I should also mention that I am able to add things to the menu via

        {
            "keys": "p.C",
            "name": "Compile project",
            "icon": "gear",
            "type": "command",
            "command": "workbench.action.tasks.build"
        },

but I am unable to redefine a keybinding like so

        {
            "keys": "p.l",
            "name": "Launch package",
            "icon": "rocket",
            "command": "workbench.action.tasks.runTask",
            "args": "state_machine: Launch"
        },
erichlf commented 9 months ago

Wrong place.