Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline inner "record" not properly highlighted #1444

Closed
fbricon opened this issue May 12, 2020 · 3 comments · Fixed by #3230 or eclipse-jdtls/eclipse.jdt.ls#2789
Closed

Multiline inner "record" not properly highlighted #1444

fbricon opened this issue May 12, 2020 · 3 comments · Fixed by #3230 or eclipse-jdtls/eclipse.jdt.ls#2789

Comments

@fbricon
Copy link
Collaborator

fbricon commented May 12, 2020

2nd part of #1442: Inner Java 14's record, when the record keyword is on a separate line, is not properly colored, even with semantic highlighting turned on.

public class Demo {
  public static void main(String[] args) {
    record
    Foo(int i,int j){}
    Foo foo = new Foo(0, 1);
    System.out.println(foo);
  }
}

is displayed as:
Screen Shot 2020-05-12 at 5 12 08 PM

@fbricon
Copy link
Collaborator Author

fbricon commented May 12, 2020

@Eskibear is this something you can help with?

@Eskibear
Copy link
Contributor

I find that the issue also exists for multi-line inner class.

public class Foo {
    public static void main(String[] args) {
        class 
        Bar {
            
        }
    }
}

In the main function you'll see both class and Bar are not highlighted. Turn semantic highlighting on, it will highlight Bar (types and variables have been supported), but the class is still not highlighted (semantic highlighting for keywords hasn't been implemented).

Semantic highlighting should be the right way to go, but some investigation is required as I don't know how far RecordDeclaration has been supported in upstream JDT core.

@Eskibear
Copy link
Contributor

Eskibear commented May 13, 2020

As for keywords like "class" and "record", it would be good and cheap to leverage syntax highlighting (as long as they got atom/language-java#186 fixed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment