]> git.ipfire.org Git - thirdparty/vim.git/commit
runtime(java): Provide support for syntax preview features
authorAliaksei Budavei <0x000c70@gmail.com>
Tue, 27 Aug 2024 20:32:13 +0000 (22:32 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 27 Aug 2024 20:32:13 +0000 (22:32 +0200)
commit8556e23ee90448f01b612d337599f6e8f86679ea
treeed201a537b455d83473cf534f804b11f8e37493f
parentd56c451e1c05310562c5282352d7bb287c16323c
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>
runtime/doc/syntax.txt
runtime/syntax/java.vim
runtime/syntax/testdir/dumps/java_previews_430_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/java_previews_430_01.dump [moved from runtime/syntax/testdir/dumps/java_string_03.dump with 83% similarity]
runtime/syntax/testdir/dumps/java_previews_430_02.dump [moved from runtime/syntax/testdir/dumps/java_string_04.dump with 80% similarity]
runtime/syntax/testdir/dumps/java_previews_430_03.dump [moved from runtime/syntax/testdir/dumps/java_string_05.dump with 94% similarity]
runtime/syntax/testdir/dumps/java_string_00.dump
runtime/syntax/testdir/dumps/java_string_01.dump
runtime/syntax/testdir/dumps/java_string_02.dump
runtime/syntax/testdir/input/java_previews_430.java [new file with mode: 0644]
runtime/syntax/testdir/input/java_string.java