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

Error when remapping to commands with name starting with "extension." #3307

Closed
hiaux0 opened this issue Dec 30, 2018 · 7 comments
Closed

Error when remapping to commands with name starting with "extension." #3307

hiaux0 opened this issue Dec 30, 2018 · 7 comments
Labels

Comments

@hiaux0
Copy link

hiaux0 commented Dec 30, 2018

Describe the bug

  • With the debug log level I get the following console error
[Extension Host] error: Remapper: normalModeKeyBindingsNonRecursive. 
Invalid configuration. 
Command does not exist. before= ,;. command=extension.insertSemicolon. args=undefined..

// Note that my <leader> is space

I just got this bug one or two weeks ago, as remapping to commands starting with exentension. was working fine.

The command in question can be found via the shortcut settings and works fine with ctrl+,
image

  • Other extensions work fine, eg.
[Extension Host] debug: Remapper: normalModeKeyBindingsNonRecursive. 
loaded: before= ,b,c. command=bookmarks.clear. args=undefined.

image

To Reproduce
Steps to reproduce the behavior:

  1. Extension chrisvltn.vs-code-semicolon-insertion
  2. Remap in
"vim.normalModeKeyBindingsNonRecursive": [
  {
    "before": ["<leader>", ";"], 
    "commands": [ {"command": "extension.insertSemicolon"} ]
  },
]
  1. Attempt to execute remapped command
  2. Nothing happens

Expected behavior
In 3. from steps to repro, the command should execute

Screenshots
image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.17.3
  • VSCode version: Version 1.30.1
  • OS: MacOS Sierra 10.13

Additional context

  • Leader is space
  • I tried with normalModeKeyBindings as well, still same error
@jpoon
Copy link
Member

jpoon commented Dec 30, 2018

Interesting. Do you mind trying an experiment? Can you try explicitly activate the extension by calling the extension.insertSemicolon command through the command palette, does the keybinding work now?

@zikkurat
Copy link

Yes, I have the same problem.

@hiaux0
Copy link
Author

hiaux0 commented Dec 31, 2018

Interesting. Do you mind trying an experiment? Can you try explicitly activate the extension by calling the extension.insertSemicolon command through the command palette

You mean here?
image

Works normal on command call via command palette.

does the keybinding work now?

Still not working unfortunately.

@jpoon
Copy link
Member

jpoon commented Jan 1, 2019

With #3296, we added a check on remapped commands to ensure that they were 'valid' commands. We get a list of valid commands through VS Code's getCommands() API call so it's interesting that extension.insertSemicolon is not in that list.

@jpoon
Copy link
Member

jpoon commented Jan 1, 2019

Ah, ok. My suspicion was true. We load the valid commands on startup here (

await configurationValidator.initialize();
). VS Code lazy loads extension and so at that point, the insertSemicolon is not a valid command. Once you explicitly activate that extension, it'll then be OK. We'll need a code change.

@zikkurat
Copy link

zikkurat commented Jan 8, 2019

Nothing needed to be done. After vscode was updated to 1.30.2, the problem was fixed.

@dcecile
Copy link

dcecile commented Jan 23, 2019

🤔 Upgrading from VS Code 1.30.1 to 1.30.2 didn't fix it for me:

    {
      "before": ["<leader>", "i"],
      "commands": [
        "python.sortImports"
      ]
    }

[Extension Host] warn: Remapper: normalModeKeyBindingsNonRecursive. before= ,i. command=python.sortImports. args=. Command does not exist.

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

No branches or pull requests

4 participants