Open ThaisRobba opened 10 years ago
+1
+1
Imho all method calls could me muted. The same for fields referenced by dot. So that the only thing that would get semantically-highlighted would be the local (or closure) variables and functions. Then we don't need any blacklists for frameworks.
Regrettably, this is not possible with the current setup as Acorn only gives us the scope name
, not whether it refers to a method or variable. We could get much, much more information if we were able to let Acorn parse instead of just tokenize, but the Atom API demands that grammars be able to process source line-by-line, which is not compatible with Acorn's parsing model.
I really like semantic highlighting - but the current implementation is a bit too crazy on colors. I can't find my variables or what is happening to them - and reading code is nearly impossible when chaining.
Muting method calls, I believe, would be extremely beneficial. On the left is the current implementation, on the right is the same code but with muted methods (using this demo http://brooks.io/syntax-highlight/v2/). I was thinking that built-in method calls could be the same color and style as built-in keywords (so .length would be the same color as var). User-made methods could be a different shade of gray.
PS: Of course, there might be another way or a better solution. As it is, it is unusable with many frameworks.