ajaxorg/ace — pull request #931 by gjtorikian (2012-09-12 07:55:43+00:00)
Title: Theme tooling updates

Going off of [the comments I made in my last PR](https://github.com/ajaxorg/ace/pull/930), I went ahead and updated the _.tmtheme_ generation tool and batch of CSS themes we currently have.

It works like this: after parsing the _.tmtheme_ file in _tools/tmthemes_, the tool turns the existing CSS into a JSON object, and turns the newly parsed CSS into a JSON object. It does a comparisson of the two objects, and if the parsed CSS has a new rule, it's inserted directly into the existing CSS file **without overwriting any other rules**. It's happened to me quite often that I have to make an updated to `supportedScopes` and it ends up overwriting the entire existing CSS file.

At the end of the parsing, the tool spits out a list of all tokens it didn't match, ordered by frequency:

```json
...
6': [ 'markup.inserted', 'constant.other.symbol' ],
'7':
[ 'text source',
'constant.other.color',
'entity.name.tag.css',
'punctuation.section.embedded',
'meta.function-call',
'markup.deleted',
'support.other.variable',
'entity.name.type.class' ],
'8': [ 'meta.separator', 'variable.other' ],
'12': [ 'declaration.tag', 'entity.name.class' ],
'19': [ 'entity.other.inherited-class' ] }
```

I guess we could modify `supportedScopes` to include this information? Actually I don't know how to manage it. For example, we have `entity.other.attribute-name` already--is `entity.other.inherited-class` (which shows up _19_ times!) really necessary to include? Can we intelligently fall back on just the parent (`entity.other`)?

* * *

Now, one of the downsides of this PR is that it's changed every CSS file to remove the last semicolon in a selector. This is apparently by design from the node module I am using, [css-stringify](https://github.com/visionmedia/node-css-stringify). New rules have also been added based on new tokens I added to the theme file.

I also switched out several of the "hand maintained" theme files to the best _.tmtheme_ file I could find. The difference is staggering, in that what we offer is vastly different than the actual theme. For example:

* [Chrome](http://i.imgur.com/UWqKQ.png) (new on left, current on top, Chrome tools on bottom)
* [GitHub](http://imgur.com/a/UUM5m) (New on top, GitHub in middle, current on bottom)

It's pretty clear that the new themes are much closer to the originals. Sadly I could not find themes for Crimson Editor or Eclipse. "Mac Classic" is really the Textmate default, so that file was renamed.

Finally, I also added the XCode theme. Because I like it. Actually I don't even know why we don't just generate the other themes in _tools/tmthemes_.