Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Function CodemorphsNew to Visual Studio Code? Get it now.
Function Codemorphs

Function Codemorphs

vscodeshift

|
1,006 installs
| (0) | Free
commands for refactoring functions
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

@vscodeshift/function-codemorphs

CircleCI Coverage Status semantic-release Commitizen friendly Visual Studio Marketplace Version

Commands for refactoring functions

Convert arrow function body to block statement

Before

const foo = () => 'foo!'

Position cursor anywhere in the arrow function and then run the Convert arrow function body to block statement command.

After

const foo = () => {
  return 'foo!'
}

Convert arrow function body to expression

The inverse of the above. The function body must consist only of a return statement or this will error out.

Before

const foo = () => {
  return 'foo!'
}

Position cursor anywhere in the arrow function and then run the Convert arrow function body to expression command.

After

const foo = () => 'foo!'
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft