Prevent autocomplete in Visual Studio Code

2019-01-23 01:09发布

问题:

I'm using the new Visual Studio Code, which is clearly not ready for primetime yet, but I'm hoping to resolve a problem I'm having.

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 config options I can find, I've already set:

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

Any other ideas on how to stop this?

EDIT: Also true for things like begin (it adds end) and I'm sure lots more.

回答1:

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

"editor.acceptSuggestionOnCommitCharacter": false

configuration disables this behavior.



回答2:

By now, a year later, 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 docs: https://code.visualstudio.com/docs/editor/intellisense#_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": 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": false,

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

    // Enable word based suggestions
    "editor.wordBasedSuggestions": false
}


回答3:

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

"editor.quickSuggestions.other": false

This disables most of the spurious suggestions.