Project: aptanastudio
Issue APSTUD-3792: JavaScript Code Formatter: More options for Spaces - Parentheses
The JavaScript Code Formatter is nice, but it's missing a few key options for me to use it. Specifically, there are only two options for Spaces - Parentheses (Before/After). However, parentheses are used for multiple reasons - if, function declarations, function calls, etc. My desired spacing for parentheses doesn't apply to all of these. For example, if I set Before = 1 and After = 0, I get: {code} var a = function (b, c, d) { // BAD Don't want the space before function arguments here alert (b + c + d); // BAD Don't want the space before invokation arguments here } var c = a ? 10 : 20; var bb = { "a": 1, "b": 2, "c": 3 }; for (var i = 0, j = 0; i < 8 && j >= 0; i++, --j) { // GOOD This space is good alert ("(a " + a + ",j " + j + ")"); // BAD Don't want the space before invokation arguments here } if (xyz[1] >= 5) { // GOOD This space is good {code} If I set Before = 0 and After = 0, I get {code} var a = function(b, c, d) { // GOOD alert(b + c + d); // GOOD } var c = a ? 10 : 20; var bb = { "a": 1, "b": 2, "c": 3 }; for(var i = 0, j = 0; i < 8 && j >= 0; i++, --j) { // BAD I want a space here alert("(a " + a + ",j " + j + ")"); // GOOD } if(xyz[1] >= 5) { // BAD I want a space here {code} If there were separate Parentheses rules for function arguments, function invocation, and for/if/etc clauses, it'd be much nicer.
Story points: 20