summaryrefslogtreecommitdiff
path: root/runtime/queries/comment/highlights.scm
blob: 9583f9c534142f285f5de52bb4c49f7115b31ee5 (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
[
 "("
 ")"
] @punctuation.bracket

":" @punctuation.delimiter

; Hint level tags
((tag (name) @hint)
 (#match? @hint "^(HINT|MARK|PASSED|STUB|MOCK)$"))

("text" @hint
 (#match? @hint "^(HINT|MARK|PASSED|STUB|MOCK)$"))

; Info level tags
((tag (name) @info)
 (#match? @info "^(INFO|NOTE|TODO|PERF|OPTIMIZE|PERFORMANCE|QUESTION|ASK)$"))

("text" @info
 (#match? @info "^(INFO|NOTE|TODO|PERF|OPTIMIZE|PERFORMANCE|QUESTION|ASK)$"))

; Warning level tags
((tag (name) @warning)
 (#match? @warning "^(HACK|WARN|WARNING|TEST|TEMP)$"))

("text" @warning
 (#match? @warning "^(HACK|WARN|WARNING|TEST|TEMP)$"))

; Error level tags
((tag (name) @error)
 (#match? @error "^(BUG|FIXME|ISSUE|XXX|FIX|SAFETY|FIXIT|FAILED|DEBUG)$"))

("text" @error
 (#match? @error "^(BUG|FIXME|ISSUE|XXX|FIX|SAFETY|FIXIT|FAILED|DEBUG)$"))

(tag
 (name) @ui.text
 (user)? @constant)

; Issue number (#123)
("text" @constant.numeric
 (#match? @constant.numeric "^#[0-9]+$"))

; User mention (@user)
("text" @tag
 (#match? @tag "^[@][a-zA-Z0-9_-]+$"))