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:
committed by
Christian Brabandt
parent
1be5b375c4
commit
159d392427
@@ -1,6 +1,6 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'indent4'
|
||||
// VIM_TEST_SETUP let g:java_highlight_generics = 1
|
||||
// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@@ -77,6 +77,14 @@ abstract class Indent4MethodsTests
|
||||
|
||||
public static Class<?> classLock() { return Indent4MethodsTests.class; }
|
||||
|
||||
public <E extends Comparable<? super E>> java.util.List<E> filter(
|
||||
java.util.function.Predicate<? super E> filter,
|
||||
java.util.List<? extends E> cs)
|
||||
{
|
||||
return cs.stream().filter(filter)
|
||||
.collect(java.util.stream.Collectors.toUnmodifiableList());
|
||||
}
|
||||
|
||||
@Override @SuppressWarnings("cast")
|
||||
public String toString() { return (String) "Indent4MethodsTests"; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user