Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

70
Vistas
Why does VSCode not recognize the JavaScript spread operator and autocompletes instead?

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).

12 months ago · Santiago Trujillo
6 Respuestas
Responde la pregunta

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.

12 months ago · Santiago Trujillo Denunciar

0

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

12 months ago · Santiago Trujillo Denunciar

0

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.]

12 months ago · Santiago Trujillo Denunciar

0

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.

12 months ago · Santiago Trujillo Denunciar

0

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

12 months ago · Santiago Trujillo Denunciar

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

12 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos