atom/language-java

Multiple variables defined in a single line with initializers are not recognized.

Opened this issue · 3 comments

Description

class A {
    void f(int a) {
        int b = a + 1, c = a + 2;

image

Expected behavior: [What you expect to happen]

c should be recognized as variable.other.definition.java, meta.definition.variable.java just like b.

Good catch. I don't think it was ever supported. Before I moved code from the variable definition, such variables would be assigned the parent scope and highlighted as such creating an impression that they were parsed as variables. And my change basically exposed the issue.

This also applies to field definition in class:

public class AssetsKit {
    private static final Log log = Log.getLog(AssetsKit.class);
    private static final Charset UTF_8 = Charset.forName("UTF-8");
    private static final String JS_EXT = ".js", CSS_EXT = ".css";
    private static final String PROTOCOL = "^https?://.+$";
}

image

I will investigate, thanks.