File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change
1
+ ; Identifiers
2
+
3
+ (type_identifier) @type
4
+ (primitive_type) @type.builtin
5
+ (field_identifier) @property
6
+
1
7
; Identifier conventions
2
8
3
9
; Assume all-caps names are constants
4
10
((identifier) @constant
5
11
(#match? @constant "^[A-Z][A-Z\\d_]+$'"))
6
12
13
+ ; Assume uppercase names are enum constructors
14
+ ((identifier) @constructor
15
+ (#match? @constructor "^[A-Z]"))
16
+
7
17
; Assume that uppercase names in paths are types
8
18
((scoped_identifier
9
19
path: (identifier) @type )
20
30
name: (identifier) @type ))
21
31
(#match? @type "^[A-Z]"))
22
32
23
- ; Assume other uppercase names are enum constructors
24
- ((identifier) @constructor
25
- (#match? @constructor "^[A-Z]"))
26
-
27
33
; Assume all qualified names in struct patterns are enum constructors. (They're
28
34
; either that, or struct names; highlighting both as constructors seems to be
29
35
; the less glaring choice of error, visually.)
61
67
(function_item (identifier) @function )
62
68
(function_signature_item (identifier) @function )
63
69
64
- ; Other identifiers
65
-
66
- (type_identifier) @type
67
- (primitive_type) @type.builtin
68
- (field_identifier) @property
69
-
70
70
(line_comment) @comment
71
71
(block_comment) @comment
72
72
You can’t perform that action at this time.
0 commit comments