Debian Codegraph @

runtime/queries/gitlab-ci/highlights.scm

raw symbols SCIP
1 (boolean_scalar) @constant.builtin.boolean
2 (null_scalar) @constant.builtin
3 (double_quote_scalar) @string
4 (single_quote_scalar) @string
5 (block_scalar) @string
6 (string_scalar) @string
7 (escape_sequence) @constant.character.escape
8 (integer_scalar) @constant.numeric.integer
9 (float_scalar) @constant.numeric.float
10 (comment) @comment
11 (anchor_name) @type
12 (alias_name) @type
13 (tag) @type
14 (yaml_directive) @keyword
15
16 (block_mapping_pair
17 key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable.other.member))
18 (block_mapping_pair
19 key: (flow_node (plain_scalar (string_scalar) @variable.other.member)))
20
21 (flow_mapping
22 (_ key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable.other.member)))
23 (flow_mapping
24 (_ key: (flow_node (plain_scalar (string_scalar) @variable.other.member))))
25
26 [
27 ","
28 "-"
29 ":"
30 ">"
31 "?"
32 "|"
33 ] @punctuation.delimiter
34
35 [
36 "["
37 "]"
38 "{"
39 "}"
40 ] @punctuation.bracket
41
42 ["*" "&" "---" "..."] @punctuation.special
43
44
45 ; Highlight the toplevel keys differently as keywords
46 (block_mapping_pair
47 key: (flow_node (plain_scalar (string_scalar) @keyword (#any-of? @keyword "variables" "stages" "default" "include" "workflow"))) )
48
49 ; Highlight the builtin stages differently
50 ; <https://docs.gitlab.com/ci/yaml/#stages>
51 (block_mapping_pair
52 key: (flow_node
53 (plain_scalar
54 (string_scalar) @variable.other.member (#eq? @variable.other.member "stage")))
55 value: (flow_node
56 (plain_scalar
57 (string_scalar) @constant.builtin (#any-of? @constant.builtin ".pre" "build" "test" "deploy" ".post"))))
58 ; e.g.
59 ; ```
60 ; stages:
61 ; - build
62 ; - test
63 ; ```
64 (block_mapping_pair
65 key: (flow_node
66 (plain_scalar
67 (string_scalar) @keyword (#eq? @keyword "stages")))
68 value: (block_node
69 (block_sequence
70 (block_sequence_item
71 (flow_node
72 (plain_scalar
73 (string_scalar) @constant.builtin (#any-of? @constant.builtin ".pre" "build" "test" "deploy" ".post")))))))
74
75
76 ; Highlight defined variable names as @variable
77 ; Matches on:
78 ; ```
79 ; variables:
80 ; <variable>: ...
81 ; ```
82 (block_mapping_pair
83 key: (flow_node
84 (plain_scalar
85 (string_scalar) @keyword (#eq? @keyword "variables")))
86 value: (block_node
87 (block_mapping
88 (block_mapping_pair
89 key: (flow_node) @variable)+)))