mirror of
https://github.com/vim/vim
synced 2025-05-02 22:37:47 +02:00
Introduce a new API variable "g:java_syntax_previews" whose value must be a list of syntax preview feature numbers. Enumerate the currently supported numbers in a table at the end of the documentation entry for "ft-java-syntax". Also, disable the recognition of String Templates. Despite the withdrawal of this preview feature in its proposed form from the upcoming JDK 23 release and the fact that the JDK 22 release is coming to EOL this September, an earlier iteration of this preview feature was included in JDK 21 (LTS) whose EOL is projected to fall due in late 2028 and, therefore, retain the current implementation. Define "g:java_syntax_previews" and include number 430 in its list to enable the recognition of String Templates: ------------------------------------------------------------ let g:java_syntax_previews = [430] ------------------------------------------------------------ References: https://openjdk.org/jeps/430 (Preview) https://openjdk.org/jeps/459 (Second Preview) https://openjdk.org/jeps/465 (Third Preview) https://mail.openjdk.org/pipermail/amber-spec-experts/2024-April/004106.html closes: #15579 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
44 lines
634 B
Java
44 lines
634 B
Java
class StringTests
|
||
{
|
||
static {
|
||
String s1 = "A quick brown fox jumps over the lazy dog";
|
||
String s2 = "\"Woof\s!\"";
|
||
String s3 = """
|
||
A\s\
|
||
quick \
|
||
brown\s\
|
||
fox \
|
||
jumps\s\
|
||
over \
|
||
the\s\
|
||
lazy \
|
||
dog""";
|
||
String s4 = """
|
||
"Woof\s!\"""";
|
||
String s5 = """
|
||
String s3 = \"""
|
||
A\\s\\
|
||
quick \\
|
||
brown\\s\\
|
||
fox \\
|
||
jumps\\s\\
|
||
over \\
|
||
the\\s\\
|
||
lazy \\
|
||
dog\""";""";
|
||
|
||
// There are SPACE, FF, HT, CR, and LF after """.
|
||
String empty = """
|
||
""";
|
||
|
||
System.out.println("""
|
||
"
|
||
""
|
||
""\u005c"
|
||
""\u005c""
|
||
""\"\u0022\u0022
|
||
""\"""\u005c\u0022
|
||
""\"""\""
|
||
""\"""\""\"""");
|
||
}
|
||
}
|