22

I have been struggling with a really annoying behaviour of Visual Studio Code recently.

Whenever I try to use the JavaScript spread syntax VSCode automatically autocompletes the next piece of code (wrongly). Note I am NOT hitting TAB. Here's a demonstration of what I'm talking about:

Annoying autocomplete behaviour demonstration

Is there a way to disable this? This is really driving me mad... I am using Visual Studio Code 1.59.0 (which should be the latest release at the time of authoring this question).

Behemoth
  • 5,389
  • 4
  • 16
  • 40
  • in my setup it only gives the intellisence suggestions when I have typed `...`. What if you try with all extensions disabled. – rioV8 Aug 10 '21 at 08:31
  • 2
    OMFG YES THANK YOU! I'm not going insane.. this is new and a MIGHTY PITA!! I will try and implement one of the suggestions and hope this goes away. – 4uroraskye Aug 12 '21 at 12:40

6 Answers6

19

As I mentioned in my comment elsewhere, the github issue is Typing repeated dots in js expands to first suggestion.

In that issue a couple of temporary fixes are mentioned:

"editor.suggest.showWords": false

or

"editor.acceptSuggestionOnCommitCharacter": false

The .'s are commit characters in javascript and so one of the suggestions will be selected that you do not want.

[You might be able to increase the quick suggestions delay time as a possible fix, but I can't test that since I can't actually repro this bug on my setup.]

[If you still are facing this problem make sure to upgrade to v1.59.1, which included a fix. If that doesn't fix it for you, file an issue.]

Mark
  • 143,421
  • 24
  • 428
  • 436
3

It appears to be an issue introduced in the latest update to VSCode.

I have one laptop running the latest version that is exhibiting the issue. And another laptop that was running an older version and did not exhibit the issue. Upon updating the laptop with the older version to the latest it too now has this annoying bug...

EDIT:
As a temporary fix I just reinstalled version 1.58.2 on my laptops which has resolved the issue. https://code.visualstudio.com/updates/v1_58

Reid187
  • 53
  • 4
  • Here is the issue with a couple of temporary fixes: https://github.com/microsoft/vscode/issues/130096. @Reid187 You could add this info and fixes to your answer. – Mark Aug 10 '21 at 19:35
2

I made a user snippet to work around the issue for now:

  "Spread": {
    "scope": "javascript,typescript",
    "prefix": "spd",
    "body": ["...$1"],
    "description": "spread rest operator vs code fix"
  }

Basic but does the job. Just create a snippet and drop it in.

Harry Theo
  • 784
  • 1
  • 8
  • 28
Cody
  • 21
  • 3
1

This appears to be fixed in the latest commit, which is 1.59.1.

Chicago Dad
  • 11
  • 1
  • 2
0

There could be many causes for this problem, try to: install js extentions If doesn't work try to delete the .vscode folder under your home dir and reinstall vscode, this should solve the problem.

  • I was actually hoping somebody would be able to reproduce the *issue* and has found a concrete solution. Nevertheless thanks for your help! – Behemoth Aug 09 '21 at 17:36
0

Here is how to fix that

  • Press ctrl+, (control + comma)

  • Type editor.suggest.showWords in the search box

  • Uncheck the Setting, (It says When enabled intellisense shows text-suggestions)


Or to disable it specifically for javascript

Add the line "editor.suggest.showWords": false in settings.json, inside the [javascript] section.

You can open settings.json by pressing F1, and typing settings.json


More information about this issue and the temporary fix can be found here on the github issue on the official vscode repository

Abraham
  • 12,140
  • 4
  • 56
  • 92