0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

runtime(java): Optionally highlight the :: token for method references

This token will be highlighted, similar to the arrow of
lambda expressions, whenever "g:java_highlight_functions" is
defined.

Also:

- Improve the recognition of _switch-case_ labels
  (D-Cysteine).
- Remove insignificant empty statements in syntax test
  files.

closes: #15322

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.13
https://github.com/fleiner/vim/pull/1

Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Aliaksei Budavei
2024-07-24 20:15:15 +02:00
committed by Christian Brabandt
parent df77c8ad39
commit e73e5b889b
41 changed files with 855 additions and 37 deletions

View File

@@ -55,7 +55,7 @@ class SwitchTests // JDK 21+.
case null: { echo("null"); break; }
case Letters[] ll: { echo("SwitchTests$1Letters[]"); break; }
default: { echo("java.lang.Object"); break; }
};
}
echo(switch (o) {
case null -> "null";
@@ -69,7 +69,7 @@ class SwitchTests // JDK 21+.
case 'a': { echo('a'); break; }
case 'b': { echo('b'); break; }
default: { echo('\u0000'); break; }
};
}
echo(switch (ch) {
case 'a' -> 'a';
@@ -83,7 +83,7 @@ class SwitchTests // JDK 21+.
case ((byte) 0): { echo((byte) 0); break; }
case ((byte) 1): { echo((byte) 1); break; }
default: { echo((byte) -1); break; }
};
}
echo(switch (b) {
case ((byte) 0) -> (byte) 0;
@@ -97,7 +97,7 @@ class SwitchTests // JDK 21+.
case ((short) 0): { echo((short) 0); break; }
case ((short) 1): { echo((short) 1); break; }
default: { echo((short) -1); break; }
};
}
echo(switch (sh) {
case ((short) 0) -> (short) 0;
@@ -111,7 +111,7 @@ class SwitchTests // JDK 21+.
case 0b0__00___000: { echo(0); break; }
case 0x000___00__1: { echo(1); break; }
default: { echo(-1); break; }
};
}
echo(switch (i) {
case 0_0_0_0_0 -> 0;