xsburg / vscode-javascript-booster

Sprinkle extra refactorings, code actions and commands over your JavaScript! 🍩 TypeScript and Flow are first class citizens as well!
https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster
160 stars 13 forks source link

How to activate "Convert shorthand arrow function to statement" #16

Closed ovidiuch closed 5 years ago

ovidiuch commented 5 years ago

Hello,

Thanks for this awesome VSCode extension!

I'm trying to use the Convert shorthand arrow function to statement function but I can't find the option in my code?

Here's an example: image

What are the requirements for this transform to become available?

xsburg commented 5 years ago

Hello @skidding,

The general logic behind most code actions in this extension is that you don't need to select the whole statement for it to work. Instead, it's just enough to place the cursor at the right place. In this particular case - somewhere near the arrow:

image

Cheers!

ovidiuch commented 5 years ago

@xsburg Thanks, that seems to work!