jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

Parenthesis in string confuses Java syntax highlighter #148

Closed wangweij closed 8 years ago

wangweij commented 9 years ago

Pasting the code below into Sublime Text 3 and the 2nd method is considered part of a string literal.

public class A1 {
    public static void main(String[] args) throws Exception {
        throw new Exception
                ("hello (world)");
    }

    void x() {
        // Nothing
    }
}

However, if I put "throw" and "hello" into one line, it looks OK.

This is Sublime Text b3095 on Ubuntu 14.04.2 64 bit.

screenshot from 2015-08-03 08 52 05

chuim commented 8 years ago

Just to add an example that seems to trigger the same condition:

class MyClass {
    String K_STRING = ImaginaryStaticMethod(");");

    functionLooksLikeTextAsAllFollowing() {
    }
}
FichteFoll commented 8 years ago

@chuim your particular example is a duplicate of the "just-fixed" #172.

chuim commented 8 years ago

@FichteFoll thanks for the heads up!

wbond commented 8 years ago

This is fixed in the latest syntax from https://github.com/sublimehq/Packages, and will be part of dev build 3112.

chuim commented 8 years ago

Cool. I'll check it out in the release of the next dev build.