mirror of
				https://github.com/vim/vim.git
				synced 2025-10-31 09:57:14 -04:00 
			
		
		
		
	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>
		
			
				
	
	
		
			79 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| // 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)
 | |
| 	{
 | |
| 	}
 | |
| }
 |