简体   繁体   中英

change hints accept key in VS code

i new in VS code i want to change hint accept key from "Enter" to "space" and "."

and of course this keys works in normal edit and only works when hint bar is open

i tried something like this on keybinding.json

// Place your key bindings in this file to overwrite the defaults
[
      {
          "key": "space",
          "command": "repl.action.acceptInput",
          "when": "parameterHintsVisible"
      }
]

but it doesn't work , where i going wrong?

I believe the command you are looking for is acceptSelectedSuggestionOnEnter :

{
    "key": "space",
    "command": "acceptSelectedSuggestionOnEnter",
    "when": "acceptSuggestionOnEnter && editorTextFocus && suggestWidgetVisible"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM