1

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

noirsociety
  • 314
  • 1
  • 2
  • 9
  • 1
    This is a bug. Did you file a bug for this? EDIT: here it is: https://github.com/microsoft/vscode/issues/130096 – BrDaHa Aug 11 '21 at 22:41
  • 1
    Thanks "BrDaHa" for the link :) I truly hope the next update of VSCode will remove this bug. But for those who shares the same predicament as I do, the current solution is to add the following to settings.json: "editor.acceptSuggestionOnCommitCharacter": false Here is the link: github.com/microsoft/vscode/issues/130266 – noirsociety Aug 12 '21 at 04:59

1 Answers1

0

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?

Manuel Sánchez
  • 174
  • 1
  • 7
  • Thanks Manuel for the reply. I've tried declaring the arrow function as well as declaring the whole function and the behavior still remains. I don't recall changing any setting related to autocompletion at all but I do welcome any suggestions regarding the setting that might prevent this predicament. – noirsociety Aug 10 '21 at 14:25