For one thing, you get the "shadowing job" warning every time you add a new job to your config.json that has the same name as an imported job ("pretty" in this case). This is just so you don't invent a job for yourself that inadvertently has the same name as an imported job, as they would automatically share properties (which you might not want). You can silence any such warning with adding

  "config-warnings" : { "job-shadowing" : ["<job_name1>", ...], },

at the top-level of your config.json map, with an entry for each shadowed job you add to your config.json [1][2].

As for the pretty-print output, the Generator might just be doing what you asked it to do. With align-with-curlies:true you force all block contents on the level of the curlies. As you set open-curly/newline-before to "n[ever]", open-curly/indent-before is never applied (as it only applies to an opening curly on a new line [3]). As a result of the combination of these three, the indent level never increases, hence all lines stick to the first column.

Either setting align-with-curlies:false or open-curly/newline-before:"a" gives much better results.

T.


[1] http://manual.qooxdoo.org/2.1.x/pages/tool/generator/generator_config_articles.html#job-shadowing-and-partial-overriding [2] http://manual.qooxdoo.org/2.1.x/pages/tool/generator/generator_config_ref.html#config-warnings [3] http://manual.qooxdoo.org/2.1.x/pages/tool/generator/generator_config_ref.html#pretty-print

On 01/16/2013 07:41 PM, Sergio Sánchez Maffet wrote:
Hi everybody,

I'have tried to use the pretty job on a desktop project and have encountered some problems. If I invoke the job with defaults, e.g. no config.json entries, I get a result which I would like differently, so I put the following into my config.json:

  "jobs" :
  {
...

    "pretty" :
    {
      "pretty-print" :
      {
        "general" :
        {
          "indent-string"        : "    ",
          "text-width"           : 0
        },
        "comments" :
        {
          "trailing" :
          {
            "padding"            : "    "
          }
        },
        "code" :
        {
          "align-with-curlies"   : true,
          "open-curly" :
          {
            "newline-before"     : "n",
            "indent-before"      : true
          }
        }
      }
    }
  }
...

My problem is now that when I execute "./generate.py pretty", I get the Warning:

- Warning: ! Shadowing job "pretty" with local one

Which is telling me that my config is working, but I get a pretty print without any indentation?
Whats wrong?

Kind regards
Sergio Sánchez Maffet


------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612


_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to