3 ms·
I've seen more than one talk where the presenter lamented a lack of highlighting based on highly nested structures. So, for example, changing the color based
by platz 12y ago
I've seen more than one talk where the presenter lamented a lack of highlighting based on highly nested structures. So, for example, changing the color based on the closure that one is in. Or, changing the color based on the execution context one is in (so one can make sure they are modifying the variable in the appropriate context).
This would be useful in langues that make heavy use of callbacks such as javascript or scala.
Not sure how hard it would be to implement though - it might require a full parse or compiler pass.
- seanmcdirmid 12y agoParsing is easy to do incrementally, but you could get there just by matching braces. I think Python-like offside rules are better for highlight purposes, however; e.g. see: http://research.microsoft.com/en-us/projects/liveprogramming/typography.aspx http://research.microsoft.com/en-us/projects/liveprogramming...
- philbo 12y agoThere are actually a few implementations of this for JS, it is an approach that Crockford has championed quite a bit (e.g https://plus.google.com/+DouglasCrockfordEsq/posts/XXkzgJEoE9v https://plus.google.com/+DouglasCrockfordEsq/posts/XXkzgJEoE...). Some implementations that I'm aware of, there may be others: * http://www.vim.org/scripts/script.php?script_id=4748 http://www.vim.org/scripts/script.php?script_id=4748 * https://github.com/mazurov/sublime-levels https://github.com/mazurov/sublime-levels * https://github.com/daniellmb/JavaScript-Scope-Context-Coloring https://github.com/daniellmb/JavaScript-Scope-Context-Colori...