vim/runtime/syntax/testdir/input/java_string.java
Aliaksei Budavei 8556e23ee9
runtime(java): Provide support for syntax preview features
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>
2024-08-27 22:32:13 +02:00

44 lines
634 B
Java
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
""\"""\""
""\"""\""\"""");
}
}