Mike Williamson
Mike Williamson

Reputation: 3178

How to make VS Code's auto-complete more strict?

I love Visual Studio Code, but its Intellisense auto-complete drives me crazy and I make more typos with it than it helps. So I feel I must be using it wrong.

The problem is very hard to explain, so I have a screenshot below:

VS Code auto-complete

I typed in thi. I would hope/expect/want that autocomplete would only look for anything to autocomplete that contains thi in consecutive order. But it does not. Instead it looks for anything with the letters t, h, and i in them. They needn't be next to each other, nor does the thing of interest even need to start with t.


I would like to "tame" auto-complete to only find consecutive letters. Is there a way to do this? (I use Python, Javascript, and SQL for most of my work, but I'm hoping the config is cross-language.)

Ideally, I would like the auto-complete to (a) require all letters be consecutive, (b) not require the thing of interest to start with those letters, and (c) ignore upper/lower case. But by far the most important issue to me is resolving (a).

Upvotes: 9

Views: 3007

Answers (1)

Braca
Braca

Reputation: 2805

The issue you are having is a feature added in November 2017 update. There is currently no way to turn off fuzzy autocomplete, but the issue is currently open on GitHub and the setting to change this behavior will be added.

In the meantime you can tweak your autocomplete with these settings:

"editor.wordBasedSuggestions": false,
"javascript.nameSuggestions": false,
"editor.snippetSuggestions": "bottom", // inline, none
"editor.suggestSelection": "recentlyUsedByPrefix"

From official docs:

When using the last option, recentlyUsedByPrefix, VS Code remembers which item was selected for a specific prefix (partial text). For example, if you typed co and then selected console, the next time you typed co, the suggestion console would be pre-selected.
This lets you quickly map various prefixes to different suggestions, for example:
co -> console and con -> const.

And maybe:

"editor.quickSuggestions": {
    "other": false,
    "comments": false,
    "strings": false
  },

It doesn't solve your problem completely, but it's the closest you can get without digging through VS Code source and creating an extension.

Upvotes: 5

Related Questions