diff options
author | George Fraser <george@fivetran.com> | 2018-10-09 20:32:48 -0700 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2018-10-09 20:32:48 -0700 |
commit | 134ac76b2db00cfc05796c98604cbb1e1f65abb9 (patch) | |
tree | 97945edfb44cc4b753555564963a5ab5b679978d /lib | |
parent | f65e7db2630b9b4618fb2654d77752c988fb0f44 (diff) | |
download | java-language-server-134ac76b2db00cfc05796c98604cbb1e1f65abb9.zip |
Simplify variable declaration
Diffstat (limited to 'lib')
-rw-r--r-- | lib/java.tmLanguage.json | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/java.tmLanguage.json b/lib/java.tmLanguage.json index b92e93a..9f727cb 100644 --- a/lib/java.tmLanguage.json +++ b/lib/java.tmLanguage.json @@ -975,25 +975,34 @@ ] }, "variables": { - "begin": "(?x)\n(?=\n (\n (void|boolean|byte|char|short|int|float|long|double|var)\n |\n (?>(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n (\n <[\\w<>,\\.?\\s\\[\\]]*> # e.g. `HashMap<Integer, String>`, or `List<java.lang.String>`\n )?\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|;)\n)", + "begin": "(void|boolean|byte|char|short|int|float|long|double|var|(\\w+\\.)*\\w+)(<[\\w<>,\\.?\\s\\[\\]]*)?(\\[\\])*\\s+(?=\\w+)", "end": "(?=;)", "name": "meta.definition.variable.java", - "patterns": [ - { - "include": "#all-types" - }, - { - "match": "[\\w$]+", - "name": "variable.other.declaration.java" + "beginCaptures": { + "1": { + "name": "entity.name.type.variable.java" }, + "3": { + "patterns": [ + { + "include": "#generics" + } + ] + } + }, + "patterns": [ { - "begin": "=", + "begin": "(\\w+)(\\[\\])*\\s*(=)", + "end": "(?=[;,])", "beginCaptures": { - "0": { + "1": { + "name": "variable.other.declaration.java" + }, + "3": { "name": "keyword.operator.assignment.java" } }, - "end": "(?=;)", + "name": "meta.definition.initializer.java", "patterns": [ { "include": "#code" |