Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

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

Open
felixhao28 opened this issue Nov 30, 2018 · 3 comments

Comments

@felixhao28
Copy link

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.

@sadikovi
Copy link
Contributor

sadikovi commented Dec 2, 2018

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.

@felixhao28
Copy link
Author

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

@sadikovi
Copy link
Contributor

sadikovi commented Dec 4, 2018

I will investigate, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants