summaryrefslogtreecommitdiff
path: root/runtime/queries/groovy/highlights.scm
blob: 4e94ccd3a1ee57516f9e2c278ddbac940356216a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(unit
  (identifier) @variable)

(string
  (identifier) @variable)

(escape_sequence) @constant.character.escape

(block
  (unit
    (identifier) @namespace))

(func
  (identifier) @function)

(number) @constant.numeric

((identifier) @constant.builtin.boolean
  (#any-of? @constant.builtin.boolean "true" "false"))

((identifier) @constant
  (#match? @constant "^[A-Z][A-Z\\d_]*$"))

((identifier) @constant.builtin
  (#eq? @constant.builtin "null"))

((identifier) @type
  (#any-of? @type
    "String"
    "Map"
    "Object"
    "Boolean"
    "Integer"
    "List"))

((identifier) @function.builtin
  (#any-of? @function.builtin
    "void"
    "id"
    "version"
    "apply"
    "implementation"
    "testImplementation"
    "androidTestImplementation"
    "debugImplementation"))

((identifier) @keyword.storage.modifier
  (#eq? @keyword.storage.modifier "static"))

((identifier) @keyword.storage.type
  (#any-of? @keyword.storage.type "class" "def" "interface"))

((identifier) @keyword
  (#any-of? @keyword
    "assert"
    "new"
    "extends"
    "implements"
    "instanceof"))

((identifier) @keyword.control.import
  (#any-of? @keyword.control.import "import" "package"))

((identifier) @keyword.storage.modifier
  (#any-of? @keyword.storage.modifier
    "abstract"
    "protected"
    "private"
    "public"))

((identifier) @keyword.control.exception
  (#any-of? @keyword.control.exception
    "throw"
    "finally"
    "try"
    "catch"))

(string) @string

[
  (line_comment)
  (block_comment)
] @comment

((block_comment) @comment.block.documentation
  (#match? @comment.block.documentation "^/[*][*][^*](?s:.)*[*]/$"))

((line_comment) @comment.block.documentation
  (#match? @comment.block.documentation "^///[^/]*.*$"))

[
  (operators)
  (leading_key)
] @operator

["(" ")" "[" "]" "{" "}"]  @punctuation.bracket