on master help sign in
YAML support (#667)

* added submodule * remove wrong one * added highlights * use property * add indents * shallow

commit1586b0eec7000fe511d6ed381b35130a38759c40 authoroberblastmeister <61095988+oberblastmeister@users.noreply.github.com> dateWed 1 Sep 2021, 11:16 (5 years ago) parentce7ad2b
5 files changed+49
.gitmodules+4 helix-syntax/languages/tree-sitter-yaml+1 languages.toml+8 runtime/queries/yaml/highlights.scm+33 runtime/queries/yaml/indents.toml+3
.gitmodules+4
@@ -102,6 +102,10 @@
102102 path = helix-syntax/languages/tree-sitter-protobuf
103103 url = https://github.com/yusdacra/tree-sitter-protobuf.git
104104 shallow = true
105+[submodule "helix-syntax/languages/tree-sitter-yaml"]
106+ path = helix-syntax/languages/tree-sitter-yaml
107+ url = https://github.com/ikatyang/tree-sitter-yaml
108+ shallow = true
105109[submodule "helix-syntax/languages/tree-sitter-zig"]
106110 path = helix-syntax/languages/tree-sitter-zig
107111 url = https://github.com/maxxnino/tree-sitter-zig
helix-syntax/languages/tree-sitter-yamlnew file+1

Submodule changed.

languages.toml+8
@@ -224,6 +224,14 @@ roots = []
224224comment-token = ";"
225225indent = { tab-width = 4, unit = " " }
226226
227+[[language]]
228+name = "yaml"
229+scope = "source.yaml"
230+file-types = ["yml", "yaml"]
231+roots = []
232+comment-token = "#"
233+indent = { tab-width = 2, unit = " " }
234+
227235# [[language]]
228236# name = "haskell"
229237# scope = "source.haskell"
runtime/queries/yaml/highlights.scmnew file+33
@@ -0,0 +1,33 @@
1+(block_mapping_pair key: (_) @property)
2+(flow_mapping (_ key: (_) @property))
3+(boolean_scalar) @boolean
4+(null_scalar) @constant.builtin
5+(double_quote_scalar) @string
6+(single_quote_scalar) @string
7+(escape_sequence) @string.escape
8+(integer_scalar) @number
9+(float_scalar) @number
10+(comment) @comment
11+(anchor_name) @type
12+(alias_name) @type
13+(tag) @type
14+(yaml_directive) @keyword
15+(ERROR) @error
16+
17+[
18+","
19+"-"
20+":"
21+">"
22+"?"
23+"|"
24+] @punctuation.delimiter
25+
26+[
27+"["
28+"]"
29+"{"
30+"}"
31+] @punctuation.bracket
32+
33+["*" "&"] @punctuation.special
runtime/queries/yaml/indents.tomlnew file+3
@@ -0,0 +1,3 @@
1+indent = [
2+ "block_mapping_pair",
3+]