How to make VS Code autocomplete a callable property to an arrow function instead of a regular function?

26 Views Asked by At

When working with ts/tsx files, VS Code autocompletion for callable properties includes 2 options: propertyName and propertyName(args):

autocompletion options

But using the second option produces a regular function:

property with a regular function

While I'd prefer an arrow function:

property with an arrow function

Is there any VS Code or Typescript setting that switches the autocompletion to arrow functions?

1

There are 1 best solutions below

1
starball On

As far as I know, at the time of this writing, this is not supported by the builtin TypeScript Language Feature extension of VS Code. The only control that currently exists over the object literal method snippets feature you're talking about is whether to enable it or not (the typescript.suggest.objectLiteralMethodSnippets.enabled setting). There was talk about having such a user configuration point, but I don't think it went through to any kind of implementation (See this comment in TypeScript issue ticket #46590 and the following comments). You could try to create a new issue ticket and ask that that discussion continue.