Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was 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

Description

@felixhao28

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.

Activity

  1. sadikovi commented on Dec 2, 2018

    @sadikovi
    Contributor

    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.

  2. felixhao28 commented on Dec 4, 2018

    @felixhao28
    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

  3. sadikovi commented on Dec 4, 2018

    @sadikovi
    Contributor

    I will investigate, thanks.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions