This Atom package enables semantic highlighting for JavaScript code. Identifiers are highlighted in different colors (the same identifier always in the same color) while everything else (like language keywords) is displayed in various shades of gray. This approach runs contrary to classical ideas about syntax highlighting but is rapidly becoming very popular.
In addition to being a useful tool for actual, productive JavaScript coding, the package also demonstrates some techniques that might serve other developers when creating similar packages for other languages:
.cson
grammar fileAcorn is a mature, fast JavaScript parser that is available through npm. Unfortunately, the requirements for an Atom grammar necessitated two customizations:
eval
-based keyword recognition to work around Atom Shell's CSP restrictions (this problem is being tracked in https://github.com/marijnh/acorn/issues/90)As a result, this package ships with a modified version of Acorn, but it would be preferable if those issues could be worked out so that Acorn can be pulled from npm in the future.
Copyright © 2014-2015 Philipp Emanuel Weidmann (pew@worldwidemann.com)
Released under the terms of the MIT License