On 01/17/2012 05:16 PM, Marc Puts wrote:
>
>>> [x] More control over the placement of curly braces.
>> Could you elaborate a bit, e.g. giving a short example what you would
>> like to achieve?
> The logic that the pretty printer currently applies to curlies is not
> entirely clear to me.
> By observation, I *assume* that it works like this:
>
> if "contents of braces spans 0 or 1 lines" then "put opening brace on
> same line" else "put opening brace on new line".

Yes, that's pretty much it for the 'mixed' handling of the opening curly 
(which is the default), which is oriented towards the complexity of the 
block :-) .

> If would like to control whether or not curlies are placed on a new line
> (always or never) for
> - class level maps ("members", "statics", "properties")
> - property definitions
> - (anonymous) functions
> - if/else statements
> - switch statements
> - ...
>
> Ideally, the pretty-printer would even differentiate between class
> member functions (i.e. functions defined as a member of the
> members/statics maps) and "normal" functions. (Even though, from a
> javascript perspective, there's no difference).

... so you could have something like

members :
{  // <- on new line, for class-level map
   foo : function () { // <- on same line, for member functions
       var bar = function ()
       { // <- on new line, for "normal" functions

??? - That looks demanding. Also, it would require a whole slew of new 
config keys, like

   "open-curly" : {
      "class-level-map" : ...
      "property-definition" : ...
      "functions-member" : ...
      "functions-other" : ....
      "loop-if" : ...
      "loop-while" : ...
      "loop-switch" : ...


T.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to