mamacdon/mamacdon.github.com — pull request #6 by anaran (2012-11-30 02:14:54+00:00)
Title: Expose Format JS options as "Formatting" settings in eclipse orion

Hello Mark,

it would be great if you could take a look at my contribution.

The huge diff against 0.5/plugins/beautify/jsbeautify.js is purely whitespace, caused by using [Format JS] on that file using the pre-existing 4 space indentation style. These hunks are not my focus, but I did not find a way to exclude that file from my pull request.

Now to my main concern:

I am trying to move to eclipse orion for my chrome extension and orion plugin development.

Various projects use different indentation styles and I had an immediate need to indent by
* 4 spaces (e.g. jsbeautify.js)
*1 tab (e.g. jsbeautify.html)
and the result of this need are the diffs to jsbeautify.html (also indented with my modified [Format JS], this time only formatting the script element contents using the pre-existing 1 tab indentation style).

Please not that my change also enable [Format JS] plugin for text/html, which causes trouble when applied to the whole file, but being able to indent inline scripts properly would be a huge feature, and worth it, I think.

Please let me know what adjustments you want me to make to accept my pull request, or just cherry pick what you like.

I already find the Format JS plugin very valuable.

My settings design is such that we could easily add more elaborate indenting styles.

Do you already have a list of specific indenting styles that need implementing (ala emacs indentation styles)?

Best regards
Adrian