Debian Codegraph @

runtime/queries/snakemake/highlights.scm

raw symbols SCIP
1 ; inherits: python
2
3 ; Compound directives
4 [
5 "rule"
6 "checkpoint"
7 "module"
8 ] @keyword
9
10 ; Top level directives (eg. configfile, include)
11 (module
12 (directive
13 name: _ @keyword))
14
15 ; Subordinate directives (eg. input, output)
16 ((_)
17 body: (_
18 (directive
19 name: _ @label)))
20
21 ; rule/module/checkpoint names
22 (rule_definition
23 name: (identifier) @type)
24
25 (module_definition
26 name: (identifier) @type)
27
28 (checkpoint_definition
29 name: (identifier) @type)
30
31 ; Rule imports
32 (rule_import
33 "use" @keyword.control.import
34 "rule" @keyword.control.import
35 "from" @keyword.control.import
36 "exclude"? @keyword.control.import
37 "as"? @keyword.control.import
38 "with"? @keyword.control.import)
39
40 ; Rule inheritance
41 (rule_inheritance
42 "use" @keyword
43 "rule" @keyword
44 "with" @keyword)
45
46 ; Wildcard names
47 (wildcard (identifier) @variable)
48 (wildcard (flag) @variable.parameter.builtin)
49
50 ; builtin variables
51 ((identifier) @variable.builtin
52 (#any-of? @variable.builtin "checkpoints" "config" "gather" "rules" "scatter" "workflow"))
53
54 ; References to directive labels in wildcard interpolations
55 ; the #any-of? queries are moved above the #has-ancestor? queries to
56 ; short-circuit the potentially expensive tree traversal, if possible
57 ; see:
58 ; https://github.com/nvim-treesitter/nvim-treesitter/pull/4302#issuecomment-1685789790
59 ; directive labels in wildcard context
60 ((wildcard
61 (identifier) @label)
62 (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards"))
63
64 ((wildcard
65 (attribute
66 object: (identifier) @label))
67 (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards"))
68
69 ((wildcard
70 (subscript
71 value: (identifier) @label))
72 (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards"))
73
74 ; directive labels in block context (eg. within 'run:')
75 ((identifier) @label
76 (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards"))