Javascript formatting?

Is it possible to get Intellij to align = signs when declaring a bunch of variables in javascript?


var xxxx = 1;
var yyy   = 2;


var xxxx = 1,
     yyy   = 2;

that would be capital.

Comment actions Permalink

I don't think that's possible right now for JavaScript.
(Only for Java there's an option in "Wrapping and Braces" called "Field groups -> Align in columns".)

Starting with IDEA 11 there is a feature that aligns properties like this

var foo = {
    xxxx: 1,
    y   : 2

but there's no similar formatting option vor variable declarations.

I propose you have a look at to see if there's already such a feature request and vote on it.
Else file a new issue.

Comment actions Permalink

I don't think there is a separate feature request for that but there are plans to implement it.

Comment actions Permalink

should i go ahead and create the feature request then?  Is there a timeline for this?

Comment actions Permalink

It's up to you. But it makes sense if you want to follow its status.

Comment actions Permalink

Most likely it will be in the next version, roughly in spring. No precise dates yet though.


Please sign in to leave a comment.