164

我正在使用新的Visual Studio Code,它显然还没有准备好迎接黄金时段,但我希望能解决我遇到的问题。

在 SQL 文件中,只要您键入case,它就会自动添加end,就像您正在构建一个case块一样。即使您在评论中,或将Case其用作单词的一部分(例如,select CaseID from...)。

我想完全禁用所有这些废话,因为它不能很好地为我自动完成事情。

我能找到的唯一配置选项,我已经设置了:

"editor.autoClosingBrackets": false,
"editor.suggestOnTriggerCharacters": false,

我还能做些什么来阻止这种情况?

begin对于(它添加)之类的东西也是如此end,我敢肯定还有更多。

4

10 回答 10

243

在最新版本的 Visual Studio Code 中,我发现

"editor.acceptSuggestionOnCommitCharacter": false

配置禁用此行为。

于 2018-06-08T12:27:26.477 回答
79

到 2016 年,Visual Studio Code 已经很酷了,已经准备好迎接黄金时间了。但是我仍然没有找到一种方法来完全关闭自动完成功能。

但他们的文档中确实有一些内容: Customizing IntelliSense

基本上,我把它放在我settings.json的工作区尝试关闭它。但我仍然需要评估这一点。

// Place your settings in this file to overwrite default and user settings.
{
    // Controls if quick suggestions should show up while typing
    "editor.quickSuggestions": { "other": false, "comments": false, "strings": 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": "off",

    // Controls the delay in ms after which quick suggestions will show up.
    "editor.quickSuggestionsDelay": 10,

    // Enable word based suggestions
    "editor.wordBasedSuggestions": false
}
于 2016-10-19T09:22:10.103 回答
26

截至 2019 年 5 月 17 日,这对我有效。

"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.hover.enabled": false,
"editor.minimap.enabled": false,
"editor.parameterHints.enabled": false,
"editor.quickSuggestions": false,
"editor.quickSuggestionsDelay": 10,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
"editor.wordBasedSuggestions": false,
于 2019-05-17T18:07:12.967 回答
17

这不是正确的答案,但它可能是一个更好的选择。增加:

编辑:快速建议延迟

从 50 毫秒(默认)到 500-1000 毫秒。

在这种情况下,您将有半秒的时间来击败自动完成选项,这在 95% 的情况下可能就足够了,并且在某些情况下您不会失去您可能想要的功能。

于 2019-05-07T02:43:44.883 回答
8

重申答案以方便人们浏览:打开您的设置⌘</kbd> + , or Ctrl + ,.

{
    "editor.quickSuggestions": false
}
于 2019-03-12T04:36:17.193 回答
7

在当前版本的 Visual Studio Code 中,将其添加到您的用户设置中:

"editor.quickSuggestions.other": false

这会禁用大多数虚假建议。

于 2019-01-16T21:29:05.120 回答
6

我对版本 1.22.1 进行了此更改:

"editor.wordBasedSuggestions": false

这阻止了已经出现的单词的完成。


用户设置中进行上述更改,可以在菜单FilePreferencesSettings下找到。

于 2019-04-08T04:00:07.970 回答
3

这可能会帮助您:

editor.acceptSuggestionOnCommitCharacter: false
于 2019-04-08T04:08:10.310 回答
0

这是最新的解决方案:

"editor.suggest.showClasses": false,
"editor.suggest.showColors": false,
"editor.suggest.showConstants": false,
"editor.suggest.showConstructors": false,
"editor.suggest.showCustomcolors": false,
"editor.suggest.showDeprecated": false,
"editor.suggest.showEnumMembers": false,
"editor.suggest.showEnums": false,
"editor.suggest.showEvents": false,
"editor.suggest.showFields": false,
"editor.suggest.showFiles": false,
"editor.suggest.showFolders": false,
"editor.suggest.showFunctions": false,
"editor.suggest.showInterfaces": false,
"editor.suggest.showIssues": false,
"editor.suggest.showKeywords": false,
"editor.suggest.showMethods": false,
"editor.suggest.showModules": false,
"editor.suggest.showOperators": false,
"editor.suggest.showProperties": false,
"editor.suggest.showReferences": false,
"editor.suggest.showSnippets": false,
"editor.suggest.showStructs": false,
"editor.suggest.showTypeParameters": false,
"editor.suggest.showVariables": false,
"editor.suggest.showValues": false,
"editor.suggest.showWords": false,
"editor.suggest.showUsers": false,
"editor.suggest.showUnits": false,

// controls bracket auto closing
"editor.autoClosingBrackets": "never",

// controls  specific languages tag auto closing
"html.autoClosingTags": false,
"javascript.autoClosingTags": false,
"typescript.autoClosingTags": false
于 2022-03-05T14:17:07.240 回答
0

在处理 SQL 文件时禁用“Visual Studio IntelliCode”扩展。这可能比更改对其他文件有用的设置更好。

于 2020-12-28T02:41:56.977 回答