Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml support #667

Merged
merged 7 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@
path = helix-syntax/languages/tree-sitter-protobuf
url = https://github.com/yusdacra/tree-sitter-protobuf.git
shallow = true
[submodule "helix-syntax/languages/tree-sitter-yaml"]
path = helix-syntax/languages/tree-sitter-yaml
url = https://github.com/ikatyang/tree-sitter-yaml
oberblastmeister marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions helix-syntax/languages/tree-sitter-yaml
Submodule tree-sitter-yaml added at 0e36be
8 changes: 8 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ roots = []
comment-token = ";"
indent = { tab-width = 4, unit = " " }

[[language]]
name = "yaml"
scope = "source.yaml"
file-types = ["yml", "yaml"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }

# [[language]]
# name = "haskell"
# scope = "source.haskell"
Expand Down
33 changes: 33 additions & 0 deletions runtime/queries/yaml/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(block_mapping_pair key: (_) @property)
(flow_mapping (_ key: (_) @property))
(boolean_scalar) @boolean
(null_scalar) @constant.builtin
(double_quote_scalar) @string
(single_quote_scalar) @string
(escape_sequence) @string.escape
(integer_scalar) @number
(float_scalar) @number
(comment) @comment
(anchor_name) @type
(alias_name) @type
(tag) @type
(yaml_directive) @keyword
(ERROR) @error

[
","
"-"
":"
">"
"?"
"|"
] @punctuation.delimiter

[
"["
"]"
"{"
"}"
] @punctuation.bracket

["*" "&"] @punctuation.special
3 changes: 3 additions & 0 deletions runtime/queries/yaml/indents.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
indent = [
"block_mapping_pair",
]