Reputation: 9310
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:
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).
Upvotes: 22
Views: 3552
Reputation: 15700
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
Upvotes: 0
Reputation: 181248
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.]
Upvotes: 19
Reputation: 21
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.
Upvotes: 2
Reputation: 63
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
Upvotes: 3
Reputation: 1
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.
Upvotes: 0