Home > Net >  Prevent Visual Studio Code auto-completing incorrectly whilst I type
Prevent Visual Studio Code auto-completing incorrectly whilst I type

Time:09-13

I'm having an issue with VS Code autocomplete (intellisense?) that seems completely illogical, but I can't figure out how to disable it (partly because I've no idea what to actually search for this.)

My most recent example is illustrated in the screenshot below. I am typing out a media query @media (min-width: 768px)

I then follow this up with and to continue the query, yet VS Code has for some reason decided I must want to insert a random unrelated variable here. It doesn't even have the string and anywhere in the variable names suggested.

I am fine with suggestions - they are useful when I want. But the second I hit the space bar, it automatically replaces my text. It is replacing my text despite me doing nothing other than typing what I want to type.

So many times I have been caught out because my correctly typed code is being replaced without any interaction whatsoever on my part. How do I prevent this happening?

Thanks for any help.

Image showing the autocomplete issue described

CodePudding user response:

Intellisense does not autocomplete on space, and this is not part of its default config either. Therefore this is either a bug (which could be the case), or a misconfiguration caused by an extension or changes to settings.json.

One solution for it would be to disable autocomplete on commit character altogether with "editor.acceptSuggestionOnCommitCharacter": false in settings.json. If "editor.acceptSuggestionOnEnter": "on" is left untouched, autocomplete will then only be triggered on tab/enter.

  • Related