Reformat - force long lines to be split

I tried everything, nothing seems to work, line length is set to 120, but reformat does nothing e.g. for long function calls.

P.S. This is for Webstorm.

5 comments


Wrapping and Braces > Function call arguments, Wrap if long?

0

It does the following

Before:
```
somethingTooLong(a, b, c);
```

After:

```
somethingTooLong(a, b,
  c);
```

Desired Result:

```
// If does not reach max-line
somethingTooLong(
  a, b, c
);

// Or If would reach max-line
somethingTooLong(
  a,
  b,
  c
);
```

 

0

Try Chop down if long - it will format long calls to

bar('long line',
'long line1',
'long line2',
'long line3',
'long line4',
'long line5',
'long line6')
0

I tried, but this is not what I need.

I need the following three variations depending if it fits:

bar('short line1', 'short line2');

bar(
'medium line1', 'medium line2', 'medium line3',
);

bar(
'long line',
'long line1',
'long line2',
'long line3',
'long line4',
'long line5',
'long line6'
);
0

Please sign in to leave a comment.