forked from aniani/vim
runtime(java): Compose "g:java_highlight_signature" and "g:java_highlight_functions"
With the variables defined, distinctly highlight parts of a method declaration header: its name and parameter list parens, from its type parameters, return type, and formal parameters; and distinctly highlight parts of a lambda expression: its parameter list parens and the arrow, from its formal parameters and identifiers. closes: #15083 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
88bbdb04c2
commit
01a4fb104d
78
runtime/syntax/testdir/input/java_annotations_signature.java
Normal file
78
runtime/syntax/testdir/input/java_annotations_signature.java
Normal file
@@ -0,0 +1,78 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'style'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class Annotations$Tests
|
||||
{
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface Tag
|
||||
{
|
||||
String value() default "";
|
||||
String kind() default "";
|
||||
}
|
||||
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface Text
|
||||
{
|
||||
String[] value() default {""};
|
||||
}
|
||||
|
||||
@Target({
|
||||
ElementType.METHOD,
|
||||
ElementType.PARAMETER,
|
||||
ElementType.TYPE,
|
||||
})
|
||||
@interface Labels
|
||||
{
|
||||
Label[] value();
|
||||
}
|
||||
|
||||
@java.lang.annotation.Target({
|
||||
java.lang.annotation.ElementType.METHOD,
|
||||
java.lang.annotation.ElementType.PARAMETER,
|
||||
java.lang.annotation.ElementType.TYPE,
|
||||
})
|
||||
@java.lang.annotation.Repeatable(Labels.class)
|
||||
@interface Label
|
||||
{
|
||||
String value() default "";
|
||||
Class<?> type() default Label.class;
|
||||
boolean redundant() default true;
|
||||
Text text() default @Text;
|
||||
Tag head() default @Tag();
|
||||
Tag tail() default @Tag(value = "", kind = "");
|
||||
}
|
||||
|
||||
/* Use identity cast expressions to nest TYPE_USE annotations. */
|
||||
@Label(
|
||||
(@Text({
|
||||
(@Text({ "a", "aa", "aaa", "aaaa", }) String) "as",
|
||||
(@Text({ "b", "bb", "bbb", "bbbb", }) String) "bs",
|
||||
(@Text({ "c", "cc", "ccc", "cccc", }) String) "cs",
|
||||
(@Text({ "d", "dd", "ddd", "dddd", }) String) "ds",
|
||||
}) String) "abcd")
|
||||
interface Primer { }
|
||||
|
||||
@Label @Label() @Label("""
|
||||
n\
|
||||
o\
|
||||
O\
|
||||
p""")
|
||||
@Label(head = @Tag(value = "@Label"/*, kind = "name"*/))
|
||||
@Label(// value = "Method",
|
||||
type = Annotations$Tests.class,
|
||||
redundant = !!!(1 != 1),
|
||||
head = @Tag(value = "@Label"),
|
||||
text = @Text({ "})", "({" }))
|
||||
static void noOp(@Label @Label() @Label("dummy")
|
||||
@Label(head = @Tag(/*value = "@Label",*/ kind = "name"))
|
||||
@Label(// value = "Parameter",
|
||||
type = Annotations$Tests.class,
|
||||
head = @Tag(value = "@Label"),
|
||||
text = @Text({ "){", "}(" }))
|
||||
Object dummy)
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user