java.tmbundle icon indicating copy to clipboard operation
java.tmbundle copied to clipboard

Import names starting with two or more uppercase characters are highlighted as constants

Open JorelAli opened this issue 3 years ago • 0 comments

Java class names which start with two capital letters inside an import statement are colored as constants:

import java.io.File;         // File is colored normally
import java.io.IOException;  // IOException is in blue
import java.util.UUID;       // UUID is in blue

public class MyClass {

  // Code here

}

This is likely caused by this snippet from Java.plist

<dict>
    <key>captures</key>
    <dict>
        <key>1</key>
        <dict>
            <key>name</key>
            <string>keyword.operator.dereference.java</string>
        </dict>
    </dict>
    <key>match</key>
    <string>(\.)?\b([A-Z][A-Z0-9_]+)(?!&lt;|\.class|\s*\w+\s*=)\b</string>
    <key>name</key>
    <string>constant.other.java</string>
</dict>

JorelAli avatar Apr 29 '22 16:04 JorelAli