Open 4lex1v opened 10 years ago
All pull request on fixing this are welcome. However, you should also check out ensime.
I have another issue with highlighting, i.e object name in this case:
object ModuleName { ... }
Is highlighted as a constant, but it should be a type like class or trait. In fontlock i've found this two lines:
;; object
(,(concat "\\<object[ \t]+\\("
scala-syntax:id-re
"\\)")
1 font-lock-constant-face)
;; class, trait, object
(,(concat "\\<\\(class\\|trait\\)[ \t]+\\("
scala-syntax:id-re
"\\)")
2 font-lock-type-face)
So not sure what's the right highlighting?
objects
are highlighted in different face since they are not types (classes, types and traits are).
Consider the following code
class F {}
val F: F = new F();
Here there are two F
s. The other (class F
) is a type and the other (val F
) is a value the type of which is F
.
Now consider object F
. Here also F
is a value (like with val F
), the type of which is actually F.type
I've just started using emacs, so couldn't find myself where and how to fix it, but it's quite disturbing to write function types like:
And if i declare type like
type <+>[A, B]
in addition to the previous incorrect highlighting,<+>
also has incorrect color (i expected in to be similar to=>
)Where i have the the first type highlighted with one color (like all other types) and others with a different color like std names.
Also in things like
type \//
, the hole line is treated like a comment, although it is a valid name.Is it possible to fix this at all with regexps or it more semantical parsing?