atom / language-java

Java package for Atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overrided methods in enum is not highlighted properly

felixhao28 opened this issue · comments

Prerequisites

Description

Overrided methods in enum is not highlighted properly.

enum TYPES {

    TYPE_A {
        @Override
        int f() {
            return 1;
        }
    }
    , TYPE_B {
        @Override
        int f() {
            return 2;
        }
    }, TYPE_DEFAULT;

    public int f() {
        return 0;
    }
}

image

Steps to Reproduce

  1. Open new tab and select Java language.
  2. Paste code into the editor.

Expected behavior: [What you expect to happen]

TYPE_A, TYPE_B and TYPE_DEFAULT should have the same scopes.

the three definitions of f should have proper highlight.

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

commented

Yes, we don't support that syntax explicitly. Will try adding it, thanks.

For your reference, I made a quick fix here to unblock my current work: felixhao28@ea26a49

I will leave the test case to you.

commented

Thanks! I was going to fix in a similar way, since we have the sections for different enums there. I will try patching all of your issues this weekend.