简体   繁体   English

更改提示接受VS代码中的密钥

[英]change hints accept key in VS code

i new in VS code i want to change hint accept key from "Enter" to "space" and "." 我是VS代码的新手,我想将提示接受键从“ Enter”更改为“ space”和“。”。

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 我在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 : 我相信您要查找的命令是acceptSelectedSuggestionOnEnter

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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