on master help sign in
Add additional YAML injections (#8217)
acef759Galen Abell
runtime/queries/yaml/injections.scm+52
@@ -1,2 +1,54 @@
1((comment) @injection.content
1((comment) @injection.content
2 (#set! injection.language "comment"))
2 (#set! injection.language "comment"))
3+
4+; The remaining code in this file incorporates work covered by the following
5+; copyright and permission notice:
6+;
7+; Copyright 2023 the nvim-treesitter authors
8+;
9+; Licensed under the Apache License, Version 2.0 (the "License");
10+; you may not use this file except in compliance with the License.
11+; You may obtain a copy of the License at
12+;
13+; http://www.apache.org/licenses/LICENSE-2.0
14+;
15+; Unless required by applicable law or agreed to in writing, software
16+; distributed under the License is distributed on an "AS IS" BASIS,
17+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+; See the License for the specific language governing permissions and
19+; limitations under the License.
20+
21+; Modified for Helix from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/yaml/injections.scm
22+
23+;; Github actions ("run") / Gitlab CI ("scripts")
24+(block_mapping_pair
25+ key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$")
26+ value: (flow_node
27+ (plain_scalar
28+ (string_scalar) @injection.content)
29+ (#set! injection.language "bash")))
30+
31+(block_mapping_pair
32+ key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$")
33+ value: (block_node
34+ (block_scalar) @injection.content
35+ (#set! injection.language "bash")))
36+
37+(block_mapping_pair
38+ key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$")
39+ value: (block_node
40+ (block_sequence
41+ (block_sequence_item
42+ (flow_node
43+ (plain_scalar
44+ (string_scalar) @injection.content))
45+ (#set! injection.language "bash")))))
46+
47+(block_mapping_pair
48+ key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$")
49+ value: (block_node
50+ (block_sequence
51+ (block_sequence_item
52+ (block_node
53+ (block_scalar) @injection.content
54+ (#set! injection.language "bash"))))))