Whenever I try to type 3 periods in a roll into an arrow function as the parameter, VSCode always performs code completion with the function name, as follow:

enter image description here

This, however, does not happen with a regular function declaration.

function question(...answers) {
  return answers;
}

Does anyone know how to remedy this strange behavior? I don't recall this ever happening in prior versions of VSCode.

PS: VSCode Version: 1.59.0

1

There are 1 best solutions below

1
Manuel Sánchez On

That's because in the code you have in that image, you are still not declaring an arrow function. Just writing a value inside some parentheses.

If you instead write the arrow expression first you should have no problem:

const question = () => {};

Still, did you change some setting related to autocompletion?