Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions languages/java/runnables.scm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
(#set! tag java-main)
)

; Run test function
; Run test function (marker annotation, e.g. @Test)
(
(package_declaration
(scoped_identifier) @java_package_name
Expand All @@ -52,12 +52,15 @@
body: (class_body
(method_declaration
(modifiers
(marker_annotation
[(marker_annotation
name: (identifier) @annotation_name
)
(annotation
name: (identifier) @annotation_name
)]
)
name: (identifier) @run @java_method_name
(#eq? @annotation_name "Test")
(#match? @annotation_name "Test$")
)
)
) @_
Expand All @@ -82,12 +85,15 @@
body: (class_body
(method_declaration
(modifiers
(marker_annotation
[(marker_annotation
name: (identifier) @annotation_name
)
(annotation
name: (identifier) @annotation_name
)]
)
name: (identifier) @run @java_method_name
(#eq? @annotation_name "Test")
(#match? @annotation_name "Test$")
)
)
(#eq? @nested_annotation "Nested")
Expand All @@ -107,11 +113,14 @@
body: (class_body
(method_declaration
(modifiers
(marker_annotation
[(marker_annotation
name: (identifier) @annotation_name
)
(annotation
name: (identifier) @annotation_name
)]
)
(#eq? @annotation_name "Test")
(#match? @annotation_name "Test$")
)
)
) @_
Expand All @@ -136,11 +145,14 @@
body: (class_body
(method_declaration
(modifiers
(marker_annotation
[(marker_annotation
name: (identifier) @annotation_name
)
(annotation
name: (identifier) @annotation_name
)]
)
(#eq? @annotation_name "Test")
(#match? @annotation_name "Test$")
)
)
(#eq? @nested_annotation "Nested")
Expand Down