Gus*_*imo 30 github vscode-extensions github-copilot
我真的很喜欢 Copilot,但它的评论建议可能是无意义的,而且确实让人分心。
有没有什么方法可以让代码建议保持打开状态,但每当我在代码中编辑/添加注释时关闭 Copilot?
这是我想出的解决评论建议问题的解决方法!
基本思想是创建一个键盘快捷键,按下该快捷键以禁止弹出内联建议。因此,在写评论之前,我们可以按键盘快捷键禁用建议,然后写评论,然后按键盘快捷键再次启用建议。这不是一个完美的解决方案,但它确实有效!
去做这个:
key使其正常工作。(截至撰写此评论时,github.copilot.inlineSuggest.enable我们需要在此处切换设置。如果他们将来更改该设置名称,您必须相应地更改以下代码片段。){
"key": "shift+cmd+c", // set this to whatever works for you
"command": "toggle",
// By the way, this "when" expression was inspired from the "when" expression for Copilot
// extension's "Trigger Inline Suggestions" keyboard shortcut.
"when": "editorTextFocus && !editorHasSelection",
"args": {
// This id is just a unique name you come up with yourself
"id": "toggleGithubCopilotInlineSuggestionsBeingEnabled",
// The names and values of the setting you want to toggle. In this case, it's to enable/disable the
// `github.copilot.inlineSuggest.enable` setting.
"value": [
{
"github.copilot.inlineSuggest.enable": true
},
{
"github.copilot.inlineSuggest.enable": false
}
]
}
},
Run Code Online (Sandbox Code Playgroud)
有关如何设置切换键盘快捷键的更多信息,您可以查看切换扩展的扩展页面。您还可以在此处阅读有关它的更多信息。
注意:这将允许您禁用内联建议的显示。但它不会使已经显示的当前内联建议消失。如果出现这种情况,只需按 Esc 键即可。理想情况下,您应该在内联建议弹出之前提前禁用它们。这样您就永远不必按 Esc 键。
| 归档时间: |
|
| 查看次数: |
4564 次 |
| 最近记录: |