WarWithinMe / better-align

A vscode extension to provide better vertical alignment
Other
75 stars 39 forks source link

[Feature Request] Align wrapped lines #51

Open BeSpunky opened 4 years ago

BeSpunky commented 4 years ago

OMG! This extension is the best! 👏👏👏

It would be very useful to align long lines which are wrapped.

Example: VSCode current format (simple indentation):

return veryLongThing1() && veryLongThing2()
  || someOtherThing1() && someOtherThing2();
somePromise.then(doSomething)
    .then(doSomethingElse)
    .catch(handleError);

Better Align would look like:

return veryLongThing1()  && veryLongThing2() // Space padding before `&&`
    || someOtherThing1() && someOtherThing2(); // First expression aligned to first expression on first line 
// Aligned dots for function chaining
somePromise.then(doSomething)
           .then(doSomethingElse)
           .catch(handleError);

Cheers and happy coding 🥂