hvesalai / emacs-scala-mode

The definitive scala-mode for emacs
http://ensime.org
GNU General Public License v3.0
361 stars 68 forks source link

Colouring of setters #39

Closed hvesalai closed 10 years ago

hvesalai commented 11 years ago

In def foo_=(aFoo: String) =

the string foo_= should be in function face. Is not because = as a reserved character is coloured before functions and function face does not override.

gpampara commented 11 years ago

I've hit this as well, but I believe there is a solution. Seeing as the = is a reserved character, we need to colour the foo_= after the normal font-lock colouring.

We can potentially use the hi-lock-mode which is an emacs (24) built-in. Once we have that minor mode added, we can highlight everything matching [[:graph:]]*?_= with the function face. Additionally, the minor mode will keep highlighting stuff as it is typed out. The only issues that would remain is that expressions like val foo_= will also highlight, but in this case it might be irrelevant as scala doesn't allow vals or vars to end in _=

Thoughts?

I'm doing it manually here - so far so good

hvesalai commented 10 years ago

Fixed in fontlock branch