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>
This commit is contained in:
Aliaksei Budavei
2024-08-27 22:32:13 +02:00
committed by Christian Brabandt
parent d56c451e1c
commit 8556e23ee9
11 changed files with 152 additions and 96 deletions

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2024 Aug 22
*syntax.txt* For Vim version 9.1. Last change: 2024 Aug 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -2164,6 +2164,22 @@ This will make the syntax synchronization start 50 lines before the first
displayed line. The default value is 10. The disadvantage of using a larger
number is that redrawing can become slow.
Significant changes to the Java platform are gradually introduced in the form
of JDK Enhancement Proposals (JEPs) that can be implemented for a release and
offered as its preview features. It may take several JEPs and a few release
cycles for such a feature to become either integrated into the platform or
withdrawn from this effort. To cater for early adopters, there is optional
support in Vim for syntax related preview features that are implemented. You
can request it by specifying a list of preview feature numbers as follows: >
:let g:java_syntax_previews = [430]
The supported JEP numbers are to be drawn from this table:
`430`: String Templates [JDK 21]
Note that as soon as the particular preview feature will have been integrated
into the Java platform, its entry will be removed from the table and related
optionality will be discontinued.
JSON *json.vim* *ft-json-syntax* *g:vim_json_conceal*
*g:vim_json_warnings*