javascriptreactjsideecmascript-6visual-studio-code

VSCode break comma separated values into rows


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?

UPDATE

After endless search for a few days, I decided to spend my weekend creating an extension to achieve this. See my answer below.


Solution

  • Update

    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!

    Features

    Limitation

    Demo