Is there a way to separate this format:
const { a, b, c, d, e, g, f, g, etc } = alphabet
Into
const {
a,
b,
c,
d,
e,
g,
f,
g,
etc } = alphabet
Easily?
After endless search for a few days, I decided to spend my weekend creating an extension to achieve this. See my answer below.
Today I learned How to find and replace with a newline in Visual Studio Code. In the local searchbox ( Ctrl + F ) you can insert newlines by pressing Ctrl + Enter . If you use the global search ( Ctrl + Shift + F ) you can insert newlines by pressing Shift + Enter .
You can use the multi cursor feature in this case.
editor.action.addSelectionToNextFindMatch
(on Windows it's set to CTRL+d by default) until all commas are selectedThis is how it looks like:
I've done this a couple of years ago. Nowadays, I'm using prettier which has been really helpful and more productive. However, I'm keeping a copy of the plugin I made for ad-hoc purposes and for education.
I've been looking for support on this for days but can't find any. So I decided to create an extension called Break From Comma!
I hope this helps! Contributions are very much welcome too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With