Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect keybindings appear in command palette when manual execution #53

Open
Yarakashi-Kikohshi opened this issue Mar 17, 2022 · 2 comments

Comments

@Yarakashi-Kikohshi
Copy link

Incorrect keybindings appear in command palette when manual execution

multicommand-commandPalette

I haven't defined such a keybinding. The command actually executed by the keybinding displayed here is sequence defined in multi-command.

To reproduce

To avoid the problem raised in # 16, the keybinding is defined as follows:

// keybindings.json
{
  "key": "alt+q",
  // ↑ This keybinding is displayed in command palette
  "command": "extension.multiCommand.execute",
  "args": {
    "command": "multiCommand.markdown.test"
  },
  "when": "editorTextFocus && editorLangId == markdown"
}

Keybindings for extension.multiCommand.execute are not defined.

To avoid this problem

This problem does not occur if you define the keybindings as follows:

// keybindings.json
{
  "key": "alt+q",
  "command": "multiCommand.markdown.test",
  "when": "editorTextFocus && editorLangId == markdown"
}

However, there are # 16 potential issues with this solution.

Alternatively, to really define keybinding for extension.multiCommand.execute. However, I don't want to define a keybinding because I think it's enough to call it from command palette.

Possible causes

VS Code misunderstands that even extension.multiCommand.execute including args defines a keybinding for extension.multiCommand.execute alone.

@ryuta46
Copy link
Owner

ryuta46 commented Mar 24, 2022

I reproduced this.
I have no idea to avoid this issue.

VS Code misunderstands that even extension.multiCommand.execute including args defines a keybinding for extension.multiCommand.execute alone.

I think so too.

@Yarakashi-Kikohshi
Copy link
Author

There are two simple solutions.

First idea

Divide extension.multiCommand.execute into two commands.

Currently, the command has two features:

  • Display sequence list.
  • Execute sequence specified by args. (in keybindings.json)

Of course, when divide the command into two, user may be confused.

Second idea

Accept this problem and do not mind if you see keybinding like that in command palette. If so, you need to write a note in README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants