aboutsummaryrefslogtreecommitdiffstats
path: root/queries/rbs/highlights.scm
blob: e985e8e0aa497b9d0f4bb877a3c4bf898ce18bfb (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
; Use directive

(use_clause
  [
    (type_name)
    (simple_type_name)
  ] @type)

; Buitin constants and Keywords

[
  "true"
  "false"
] @boolean

"nil" @constant.builtin

[
  "use"
  "as"
  "class"
  "module"
  "interface"
  "type"
  "def"
  "attr_reader"
  "attr_writer"
  "attr_accessor"
  "end"
  "alias"
] @keyword

"def" @keyword.function

; Members of declaration

[
 "include"
 "extend"
 "prepend"
] @function.method

(visibility) @type.qualifier

(comment) @comment @spell

(method_member
  (method_name
    [
     (identifier)
     (constant)
     (operator)
     (setter)
    ] @method))

[(ivar_name) (cvar_name)] @property

(alias_member (method_name) @function)

(class_name (constant) @type)
(module_name (constant) @type)
(interface_name (interface) @type)
(alias_name (identifier) @type)
(type_variable) @constant
(namespace (constant) @namespace)

(builtin_type) @type.builtin

(const_name (constant) @constant)
(global_name) @property

; Standard Arguments
(parameter (var_name) @parameter)

; Keyword Arguments
(keyword) @parameter

; Self
(self) @variable.builtin

; Literal
(type (symbol_literal) @symbol)

(type (string_literal (escape_sequence) @string.escape))
(type (string_literal) @string)

(type (integer_literal) @number)

; Operators

[
 "="
 "->"
 "<"
 "**"
 "*"
 "&"
 "|"
 "^"
 ] @operator

; Punctuation

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


[
 ","
 "."
 ] @punctuation.delimiter