AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
237 stars 20 forks source link

Unable to remap keyboard shortcuts #146

Closed ahshum closed 2 years ago

ahshum commented 2 years ago

Steps to reproduce

  1. Open "Keyboard Shortcuts" under the cogs menu icon at left bottom side
  2. Search "httpyac" and modify "httpYac: Send" for example
  3. Open any .http file and press the new shortcut

Expected behavior

The new shortcut should work and free up the old shortcut key

Actual behavior

The new shortcut key doesn't work and the old shortcut key is still working

Addition information

httpyac version: v5.6.2 vscode version: 1.69.2

AnWeber commented 2 years ago

I don't see anything wrong with me here. The configuration (https://github.com/AnWeber/vscode-httpyac/blob/main/package.json#L1233-L1237) looks similar to the example in VSCode (https://code.visualstudio.com/api/references/contribution-points#keybinding-example). I will try to reproduce your behavior.

AnWeber commented 2 years ago

@ahshum Removing the key will add the following settings to my Keybindings.json. However, I can still use the keyboard shortcut. If I remove the when clause the keyboard shortcut does not work anymore. But I can produce the same behavior with the built-in keyboard shortcuts (cannot reproduce again with default keybindings). I think this is a bug in vscode.

{
    "key": "ctrl+alt+r",
    "command": "-httpyac.send",
    "when": "editorTextFocus && editorLangId in 'httpyac.supportedLanguages'"
  }

I think the problem arises from httpyac.supportedLanguages context. VSCode change the when clause from editorLangId in httpyac.supportedLanguages to editorLangId in 'httpyac.supportedLanguages'

AnWeber commented 2 years ago

I created microsoft/vscode#158618, where I recreate the error with a simple extension. I only use code from the documentation, so I currently think that the error is in VSCode.

AnWeber commented 2 years ago

My issue was closed as duplicate of microsoft/vscode#157751. I think I can close this issue with that. Workaround is to remove the quotes.

ahshum commented 2 years ago

@AnWeber Thanks for taking a look.