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

runtime(java): Complement the recognition of type parameter sections

In addition to matching type parameter sections of generic
classes and records and interfaces, match such sections of
generic methods and constructors.  As before, opt for it by
defining "g:java_highlight_generics"; the diamond form still
does not qualify for this kind of recognition.

And make section patterns agree with one another in syntax
items.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4.4
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.4

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Aliaksei Budavei
2025-06-23 20:02:14 +02:00
committed by Christian Brabandt
parent 1be5b375c4
commit 159d392427
79 changed files with 454 additions and 313 deletions

View File

@@ -2,10 +2,10 @@
// VIM_TEST_SETUP let g:java_highlight_signature = 1
// VIM_TEST_SETUP let g:java_highlight_generics = 1
// VIM_TEST_SETUP let g:java_highlight_java_lang = 1
// VIM_TEST_SETUP hi link javaGenericsC1 Todo
// VIM_TEST_SETUP hi link javaGenericsC2 Error
// VIM_TEST_SETUP hi link javaWildcardBound Error
import java.math.BigInteger;
@@ -125,6 +125,12 @@ class Generics$Tests<T extends Number & Comparable<? super T>, U>
: java.lang.Class.class;
}
<A, T extends java.util.function.Supplier<A>,
B, U extends java.util.function.Supplier<B>> U convert(T o)
{
throw new UnsupportedOperationException("TODO");
}
@java.lang.annotation.Target(
java.lang.annotation.ElementType.TYPE_USE)
@interface Taggable