【发布时间】:2017-04-29 09:52:59
【问题描述】:
我正在使用 Visual Studio Code,主要用于 PHP。每次我点击 . 时,IntelliSense 都会启动并为我提供 PHP 全局变量和函数,从 $_COOKIE 开始。我通常知道我想要什么全局或函数,所以有点烦人。当我在评论区(/* ... */ 或// ...)中时,甚至会发生这种情况,这更烦人。我大部分时间都花在了回去删除$_COOKIE上。
我试过禁用它as suggested in the docs:
// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": false,
// Controls if suggestions should be accepted with "Enter" - in addition to "Tab". Helps to avoid ambiguity between inserting new lines and accepting suggestions.
"editor.acceptSuggestionOnEnter": true,
// Controls the delay in ms after which quick suggestions will show up.
"editor.quickSuggestionsDelay": 10000,
// Enable word based suggestions
"editor.wordBasedSuggestions": true
...但这绝对没有任何效果。当我击中点时,我仍然得到列表。从100 到1000 的延迟增加也没有效果。
- 如何在代码 cmets 中关闭 IntelliSense?
- 如何在点击 . 时禁用 IntelliSense,并在点击 Ctrl+Space 时显示它? (见下面的更新 2)
如何完全禁用 IntelliSense,至少对于 PHP 而言?
更新:如here 所述,禁用触发字符的快速建议是通过以下方式实现的:
// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": false
但是,上面提到的其他选项仍然没有任何作用。
更新 2: 将其添加到 keybindings.json 文件中为 possible to mess with the . binding:
{
"key": ".",
"command": "x",
}
但是,这会导致屏幕顶部出现一条警告消息,显示“找不到命令 'x'”。如果您将其留空或尝试将 null 传递给 command,它仍然不起作用,因为它不会覆盖默认键绑定。根据文档,可以通过在某个操作前加上- 来禁用它,但这对我不起作用:
"command": "-^acceptSelectedSuggestion"
或
"command": "-acceptSelectedSuggestion"
在任何一种情况下,acceptSelectedSuggesdtion 都不是我点击 时正在执行的命令。,它可能更像是:
"command": "-editor.action.triggerSuggest"
但这也不起作用。
【问题讨论】:
-
另请参阅github.com/Microsoft/vscode/issues/1657,了解 cmets 中的智能感知错误。听起来像“不会修复”,这是非常可悲的。然而,它是一个非常痒痒的痒,而且 IDE 是开源的,所以肯定有人会在某个时候用补丁刮掉它!
-
快到 2018 年了,我还要回去删除
$_COOKIE。
标签: php intellisense visual-studio-code