language-javascript-semantic icon indicating copy to clipboard operation
language-javascript-semantic copied to clipboard

Mute Methods - Avoiding the Christmas Tree Effect

Open ThaisRobba opened this issue 11 years ago • 4 comments

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.

colors

ThaisRobba avatar Jul 29 '14 21:07 ThaisRobba

+1

mik01aj avatar Mar 23 '15 15:03 mik01aj

+1

mattsawyer77 avatar Jun 05 '15 23:06 mattsawyer77

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.

mik01aj avatar Jun 19 '15 10:06 mik01aj

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.

p-e-w avatar Jul 20 '15 16:07 p-e-w