在 VisualStudio 代码中防止自动完成

我用的是新的 VisualStudio 代码

在 SQL 文件中,只要键入 C是的你好,它就会自动添加 end,就像构建 case块一样。即使是在注释中,或者使用 Case作为单词的一部分(例如,select CaseID from...)。

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

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

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

我还能做什么来阻止这一切?

对于像 B你好N这样的东西也是如此(它增加了 end) ,我肯定还有更多。

123624 次浏览

到2016年,VisualStudioCode 已经相当酷了,并且已经准备好迎接黄金时段了。但是我仍然没有找到一种简单地完全关闭自动补全的方法。

但他们的文档中确实有一些内容: 自定义智能感知

基本上,我把它放在我的 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
}

在最新版本的 VisualStudio 代码中,我发现

"editor.acceptSuggestionOnCommitCharacter": false

配置禁用此行为。

在 VisualStudio 代码的当前版本中,将其添加到用户设置中:

"editor.quickSuggestions.other": false

这使大多数虚假的建议失效。

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

编辑: 快速建议推迟

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

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

从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,

在处理 SQL 文件时禁用“ VisualStudioIntelliCode”扩展名。与更改对其他文件有用的设置相比,这可能是一个更好的选择。

以下是最新的解决方案:

"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

我按 Settings > Text Editor > Suggestions > Inline Suggest: Enabled关闭了我的程序,取消了勾选框。

(更新)这被语言设置覆盖,因此您需要做出新的更改。本文展示了如何禁用“纯文本”建议,但是您可以按照以下步骤更改所有语言的设置。如何禁用纯文本文件中的视觉工作室代码下拉建议

Examples

把这个添加到 setings.json

编辑: false,