WebStorm JavaScript Code Formatting

I prefer my code formatted like this:

var foo = new BarObject(function(paramA,paramB)
{
   ...
});

However, WebStorm reformats it to this:

var foo = new BarObject(function(paramA,paramB)
                                    {
                                       ...
                                    });



I've messed with the JavaScript CodeStyle settings but have not been able to resolve this issue.  Is there a way to have WebStorm behave as I would like?
4 comments

Did you try setting Braces placement - in function declaration to Next line in Settings | Code style | JavaScript | Wrapping and braces. It works for me as you described in 130.753

Regards,
Konstantin

0

That is the brace placement I use but it does not work in 6.0.2  129.664,  where did you get WebStorm build 130.753?

As soon as I insert the { it reformats to this:

var foo = new BarObject(function(paramA,paramB)
                                   {

                                   })



It does the same thing if I copy/paste a block of code.
0

1) Try choosing Default scheme and create your own from there (you can rollback to your current one later if required)

2) If still the same behaviour -- please show your settings (screenshot will do .. or better export it via "File | Export Settings..." by choosing only corresponding option and attach it here)

3) 130.xxx build (v7 EAP) can be found here: http://confluence.jetbrains.com/display/WI/WebStorm+7+EAP

0

Ok, I found the setting that was causing the issue.   Function call arguments - Align when multiline  was checked and shouldn't have been.  Thanks!

0

Please sign in to leave a comment.