226

I'm using the new Visual Studio Code.

In a SQL file, any time you type case, it automatically adds end, as if you were building a case block. Even if you're in a comment, or using Case as part of a word (for example, select CaseID from...).

I'd like to disable all of that nonsense completely, since it doesn't do a good job of auto completing things for me.

The only configuration options I can find, I've already set:

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

What else can I do to stop this?

It is also true for things like begin (it adds end), and I'm sure lots more.

1
  • 4
    A workaround is to press ^Z after typing case or begin. It's still a pain. Commented Oct 2, 2015 at 17:10

11 Answers 11

343

In the most recent version of Visual Studio Code I've found out that the

"editor.acceptSuggestionOnCommitCharacter": false

configuration disables this behavior.

Sign up to request clarification or add additional context in comments.

15 Comments

Thank you for this. I was typing render( and getting CanvasRenderingContext2D instead. WTF?!?!?! It wouldn't let me write what I typed without disabling on commit character. What a horrible default. Editors shouldn't replace what you type without your permission.
It's even worse when it changes to something bonkers and automatically inserts an import for that unwanted symbol..
@shybovycha Yeah I add "editor.acceptSuggestionOnCommitCharacter": false to settings.json manually but it doesn't work as expected. I mean its still auto-completed after I restart VScode. Not sure why.
Thanking you kindly because getData + ( => __acrt_get_locale_data_prefix() just isn't helping my productivity.
I changed this because it was making me crazy on doing JS imports. However, I also had to add: "editor.quickSuggestions": false, so that every time I typed "const" I didn't get a huge and irrelevant list requiring I click ESC between the keyword and variable name.
|
100

By 2016, Visual Studio Code is pretty cool and ready for prime time. But I still haven't found a way to simply turn off autocompletion completely.

But they do have some things in their documentation: Customizing IntelliSense

Basically, I put this in my settings.json to try and turn it off for the workspace. But I still have to evaluate this.

// 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
}

5 Comments

I'm likely using a new version since this was written but for me "editor.quickSuggestions" is an object where I can tweak 3 sub-values: { "other": false, "comments": false, "strings": false }. Also, maybe VS Code is smart enough to see "editor.quickSuggestions": false and set all 3 to false
I was not able to follow the instructions. Please improve the answer
acceptSuggestionOnEnter should now be set to "off" as of recent versions.
I can't stand wordBasedSuggestions, that one tends to re-suggest the same spelling errors / typos made in the past; "Here's a function name that looks deceptively similar to a real one, but it isn't!"
acceptSuggestionOnEnter still is on by default for me. Ahhhh, what a sigh of relief to turn that off... I think I'll go bake some cookies with bananas in them...
41

This works for me as of 2019-May-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,

5 Comments

Add this to disable hover tooltips: "editor.hover.enabled": false
Perhaps add a little more context? E.g., where should that be added? A file or a UI element somewhere? If a file, where is it exactly (or how can it be opened)?
@PeterMortensen More context isn't really needed. If you're unsure how to update settings in VSCode, then perusing the VSCode settings page might be helpful. Here's what a < 10 second Internet search produced: code.visualstudio.com/docs/getstarted/settings
FINALLY after trying all the other suggestions, THIS ONE WORKS! Thank you Charlie.
Awesome! acceptSuggestionOnEnter This worked for me :)
34

This isn't the correct answer, but it might be an even better option. Increase:

Editor: Quick Suggestions Delay

from 50 ms (default) to 500-1000 ms.

In this case, you'll have half a second to beat the autocomplete option, which may be enough for 95% of the time, and you won't lose the functionality that you might want in some cases.

2 Comments

Great answer. I did that. You could set it to an even higher number and challenge yourself to see if you can autocomplete faster than the machine ;-)
"editor.quickSuggestionsDelay": 1000000000 :)
13

In the current version of Visual Studio Code, add this to your user settings:

"editor.quickSuggestions.other": false

This disables most of the spurious suggestions.

1 Comment

this configuration doesn't work on vscode 1.69.1
9

I disabled mine by going to Settings > Text Editor > Suggestions > Inline Suggest: Enabled and unticking the box.

(Update) This is overwritten by the language settings, so you have make a new more changes. This post shows how to disable suggestions for Plain Text, but you can follow the steps to change the setting for all languages. How to disable visual studio code dropdown suggestions in plain text files

Examples

Comments

8

Add this to settings.json

"editor.suggestOnTriggerCharacters": false,

1 Comment

The only working solution!
3

Note: To open settings.json, run Preferences: Open User Settings (JSON) in the command palette. To open defaultSettings.json, use Preferences: Open Default Settings (JSON), to open keybindings.json, use Preferences: Open Keyboard Shortcuts (JSON), and to open defaultKeybindings.json, use Preferences: Open Default Keyboard Shortcuts (JSON). You need to save after editing these files. Note that many settings support being overridden for specific language modes.

To prevent suggestions from appearing while typing

In settings.json:

"editor.suggestOnTriggerCharacters": false,
"terminal.integrated.suggest.suggestOnTriggerCharacters": false,
"editor.quickSuggestions": {
    "other": "off",
    "comments": "off",
    "strings": "off"
},
"terminal.integrated.suggest.quickSuggestions": false,
"[dockerfile][json][json]": {
    // check defaultSettings.json or Settings UI to see which languages override editor.quickSuggestions and add them to the above list.
    "editor.quickSuggestions": {
        "other": "off",
        "comments": "off",
        "strings": "off"
    },
},

To unbind default keybindings that trigger suggestions:

("trigger" means to make the suggestion widget / inline suggestions appear)

These might change in the future. You can search for these command IDs in defaultKeybindings.json to see what they are bound to. Put the following in keybindings.json:

{
    "key": "ctrl+i",
    "command": "-editor.action.triggerSuggest",
},
{
    "key": "cmd+i",
    "command": "-editor.action.triggerSuggest",
},
{
    "key": "ctrl+space",
    "command": "-editor.action.triggerSuggest",
},
{
    "key": "cmd+space",
    "command": "-editor.action.triggerSuggest",
},
// editor.action.inlineSuggest.trigger currently not bound to anything by default

See also:

"editor.inlineSuggest.enabled": false,
"editor.suggest.preview": false,
// "editor.inlineSuggest.suppressSuggestions": false
"editor.snippetSuggestions": "none",
"editor.wordBasedSuggestions": "off",
"editor.suggest.show*": true, // replace "*" with the thing you don't want to show. You can trigger suggestions here to see the list of options.

"debug.console.historySuggestions": false,
"terminal.integrated.shellIntegration.suggestEnabled": false, // pre v1.90
"terminal.integrated.suggest.enabled": false, // v1.90+
"workbench.commandPalette.experimental.suggestCommands": false,

To unbind default keybindings that accept suggestions:

("accept" means to confirm usage of the selected suggestion option from the suggestion widget / inline suggestion widget)

In settings.json:

"editor.acceptSuggestionOnEnter": "off",
"editor.acceptSuggestionOnCommitCharacter": false,
// "debug.console.acceptSuggestionOnEnter": "off",

In keybindings.json:

{"key": "tab",         "command": "-acceptSelectedSuggestion",},
{"key": "enter",       "command": "-acceptSelectedSuggestion",},
{"key": "shift+tab",   "command": "-acceptAlternativeSelectedSuggestion",},
{"key": "shift+enter", "command": "-acceptAlternativeSelectedSuggestion",},
{"key": "tab",         "command": "-insertNextSuggestion",},
{"key": "shift+tab",   "command": "-insertPrevSuggestion",},
{"key": "tab",         "command": "-editor.action.inlineSuggest.commit",},
{"key": "ctrl+right",  "command": "-editor.action.inlineSuggest.acceptNextWord",},
{"key": "cmd+right",   "command": "-editor.action.inlineSuggest.acceptNextWord",},
{"key": "tab",         "command": "-workbench.action.terminal.acceptSelectedSuggestion",},
{"key": "enter",       "command": "-workbench.action.terminal.acceptSelectedSuggestion",},
// I'd list things for extensions like GitHub Copilot, but at that point... why would you be using those extensions? :P

To prevent automatic pairings

Since the question post mentioned case causing end to appear in SQL, see also these settings, or search for "autoclosing" in the Settings UI.

"editor.occurrencesHighlight": "multiFile",
"editor.autoClosingBrackets": "never",
"editor.autoClosingComments": "never",
"editor.autoClosingOvertype": "never",
"editor.autoClosingQuotes": "never",
"html.autoClosingTags": false,
"javascript.autoClosingTags": false,
"typescript.autoClosingTags": false,

Note that you'll still be able to trigger suggestions and inline suggestions from the command palette.

Comments

2

Here is up to date solution:

"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

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

Disable "Visual Studio IntelliCode" extension while working on SQL files. This might be a better option than changing settings that are useful for other files.

Comments

-1

None of this was working to me.

On Visual Studio Code v1.100.3, I wrote "suggestions" in the search bar, read every choices and if it looked like an unwanted suggestion disabled it.

VSC search bar settings

I also added this line in my .vscode/settings.json as they were recommanding in one of the choices:

"[cpp]": {"editor.wordBasedSuggestions": "off"}

Finally I restarted VSC and it worked.

Good luck

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.