Syntax Highlight Broken

Issue #461 duplicate
Shawn Wilder created an issue

I have noticed some inconsistencies between code bases in terms if syntax highlighting on apex class files. I have attached two screenshots, Broken Highlighting.png and Working Highlighting.png.

The working highlighting is what I think the highlighting should look like and it matches against what is specified in my settings file. This highlighting works good in a project that I have opened up with existing sources and not connecting to Illuminated Cloud yet.

The broken highlighting file is any file that is connected through Illuminated Cloud. I have tried Invalidating the Caches and restarted and IntelliJ. During the refresh of the indexes the highlighting show the correct highlighting briefly and then something happens and proceeds back to the broken highlighting.

Comments (5)

  1. Scott Wells repo owner

    Shawn, interestingly the "broken highlighting" image is actually working as designed (with the exception of the highlighting for Map in new Map<String, Integer>() which is a known bug). The difference between the two is that in the one that you've labeled "working highlighting", the data types aren't resolvable to actual data types in the OST (or locally) and are highlighting as keywords while in the one labeled "broken highlighting" those identifiers are correctly resolved to the corresponding entries in the OST and are highlighted as identifiers rather than keywords.

    This is actually exactly how the highlighting works in IntelliJ IDEA for Java, e.g.:

    SyntaxHighlighting.png

    Having said that, several people have requested to have syntax highlighting for data types be distinct from other identifiers, and that work is captured here in issue #117. Once I do that work you'll be able to decide how data types should be highlighted including distinct styling of OST data types vs. custom data types.

  2. Shawn Wilder reporter

    That is odd, sorry I don't fully understand the OST and actual data types. I am sort of new to IntelliJ :). I have a file that is attached on the left which is from my illuminated cloud project and that same file copied and pasted into a scratch.cls file and the highlighting is different. Is that expected behaviour still?

    Screen Shot 2016-11-14 at 1.29.28 PM.png

  3. Scott Wells repo owner

    No problem. Yes, that's to be expected. The scratch file isn't in any particular project/module, so IC can't resolve data types to an OST. Therefore they highlight as keywords.

  4. Log in to comment