Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Crockford style Context Coloring implemented in any code editor?

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.

like image 772
cs_brandt Avatar asked Dec 14 '12 16:12

cs_brandt


4 Answers

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

like image 194
SavoryBytes Avatar answered Nov 17 '22 10:11

SavoryBytes


Vim (GitHub):

enter image description here

Emacs (GitHub):

Screenshot of context coloring in Emacs.

like image 42
Jackson Avatar answered Nov 17 '22 11:11

Jackson


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

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

like image 9
mccainz Avatar answered Nov 17 '22 10:11

mccainz


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/

like image 8
hzoo Avatar answered Nov 17 '22 11:11

hzoo