Is Crockford style Context Coloring implemented in any code editor?

JavascriptEditorSyntax HighlightingSublimetext2

Javascript Problem Overview


I watched a video from YUIConf 2012 in which Douglas Crockford gives a talk about implementing monads in JavaScript. In this talk he gives a code example that utilizes what he calls "Context Coloring" which throws out the idea of coloring by language syntax and introduces different colors for different levels of scope. Here is the link to that specific part of the video.

http://www.youtube.com/watch?feature=player_embedded&v=dkZFtimgAcM#t=15m58s

Is this context coloring scheme implemented by any code editor for JavaScript or any language?

I use Sublime Text and this editor like every other code editor I have come across allows color to be applied to syntax. Im not sure if a plugin could solve this problem or if an editor would have to be designed from the ground up to allow this context coloring scheme.

Javascript Solutions


Solution 1 - Javascript

I just watched his video on that, great stuff. Had to give it a try, or checkout the project on GitHub https://github.com/daniellmb/JavaScript-Scope-Context-Coloring.

JavaScript Scope Context Coloring

Solution 2 - Javascript

Vim (GitHub):

enter image description here

Emacs (GitHub):

Screenshot of context coloring in Emacs.

Solution 3 - Javascript

As of Feb-13th 2013 Crockford has added an experimental context coloring feature to JSLint.

https://plus.google.com/118095276221607585885/posts/FzKnHk96m2C

Solution 4 - Javascript

There's a package for sublime now: https://github.com/mazurov/sublime-levels

It also has an online live demo at http://mazurov.github.io/eslevels-demo/

Solution 5 - Javascript

BlueJ has it (1) - but then it also may not. The context coloring for scope in javascript will certainly be more complicated than any other language such a java - which this editor works on.

The folks writing Brackets will probably do it eventually since they worship Crockford (2,3)

Why not join them in helping write it or at least tell them to?

Sources:

  1. http://blogs.kent.ac.uk/mik/2010/05/bluej-3-0-whats-new/

  2. https://github.com/adobe/brackets/issues/search?q=Crockford

  3. http://www.adobe.com/devnet/html5/articles/bracket-code-architecture.html

Solution 6 - Javascript

Not that I know of. This would be great, but it would need a lexical analyzer specific to JavaScript and it would probably not work when there are any syntax errors.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questioncs_brandtView Question on Stackoverflow
Solution 1 - JavascriptSavoryBytesView Answer on Stackoverflow
Solution 2 - JavascriptJacksonView Answer on Stackoverflow
Solution 3 - JavascriptmccainzView Answer on Stackoverflow
Solution 4 - JavascripthzooView Answer on Stackoverflow
Solution 5 - JavascriptDrMView Answer on Stackoverflow
Solution 6 - JavascriptNicolas JoyardView Answer on Stackoverflow