mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 05:37:29 +03:00
commit
099b79910f
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -7191,6 +7191,15 @@ dependencies = [
|
||||
"tree-sitter",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tree-sitter-yaml"
|
||||
version = "0.0.1"
|
||||
source = "git+https://github.com/zed-industries/tree-sitter-yaml?rev=36a64faf81931d3aaa8580a329344ac80ac0fb79#36a64faf81931d3aaa8580a329344ac80ac0fb79"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"tree-sitter",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "try-lock"
|
||||
version = "0.2.3"
|
||||
@ -8430,6 +8439,7 @@ dependencies = [
|
||||
"tree-sitter-scheme",
|
||||
"tree-sitter-toml",
|
||||
"tree-sitter-typescript",
|
||||
"tree-sitter-yaml",
|
||||
"unindent",
|
||||
"url",
|
||||
"urlencoding",
|
||||
|
@ -221,6 +221,9 @@
|
||||
},
|
||||
"TSX": {
|
||||
"tab_size": 2
|
||||
},
|
||||
"Yaml": {
|
||||
"tab_size": 2
|
||||
}
|
||||
},
|
||||
// LSP Specific settings.
|
||||
|
@ -110,6 +110,7 @@ tree-sitter-ruby = "0.20.0"
|
||||
tree-sitter-html = "0.19.0"
|
||||
tree-sitter-scheme = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "af0fd1fa452cb2562dc7b5c8a8c55551c39273b9"}
|
||||
tree-sitter-racket = { git = "https://github.com/zed-industries/tree-sitter-racket", rev = "eb010cf2c674c6fd9a6316a84e28ef90190fe51a"}
|
||||
tree-sitter-yaml = { git = "https://github.com/zed-industries/tree-sitter-yaml", rev = "36a64faf81931d3aaa8580a329344ac80ac0fb79"}
|
||||
tree-sitter-lua = "0.0.14"
|
||||
url = "2.2"
|
||||
urlencoding = "2.1.2"
|
||||
|
@ -128,6 +128,11 @@ pub fn init(languages: Arc<LanguageRegistry>) {
|
||||
tree_sitter_lua::language(),
|
||||
Some(Box::new(lua::LuaLspAdapter)),
|
||||
),
|
||||
(
|
||||
"yaml",
|
||||
tree_sitter_yaml::language(),
|
||||
None, //
|
||||
)
|
||||
] {
|
||||
languages.register(name, load_config(name), grammar, lsp_adapter, load_queries);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ brackets = [
|
||||
]
|
||||
|
||||
auto_indent_using_last_non_empty_line = false
|
||||
increase_indent_pattern = ":$"
|
||||
increase_indent_pattern = ":\\s*$"
|
||||
decrease_indent_pattern = "^\\s*(else|elif|except|finally)\\b.*:"
|
||||
|
||||
[overrides.comment]
|
||||
|
3
crates/zed/src/languages/yaml/brackets.scm
Normal file
3
crates/zed/src/languages/yaml/brackets.scm
Normal file
@ -0,0 +1,3 @@
|
||||
("[" @open "]" @close)
|
||||
("{" @open "}" @close)
|
||||
("\"" @open "\"" @close)
|
17
crates/zed/src/languages/yaml/config.toml
Normal file
17
crates/zed/src/languages/yaml/config.toml
Normal file
@ -0,0 +1,17 @@
|
||||
name = "YAML"
|
||||
path_suffixes = ["yml", "yaml"]
|
||||
line_comment = "# "
|
||||
autoclose_before = ",]}"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
{ start = "\"", end = "\"", close = true, newline = false },
|
||||
]
|
||||
|
||||
increase_indent_pattern = ":\\s*[|>]?\\s*$"
|
||||
|
||||
[overrides.string]
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
]
|
49
crates/zed/src/languages/yaml/highlights.scm
Normal file
49
crates/zed/src/languages/yaml/highlights.scm
Normal file
@ -0,0 +1,49 @@
|
||||
(boolean_scalar) @boolean
|
||||
(null_scalar) @constant.builtin
|
||||
|
||||
[
|
||||
(double_quote_scalar)
|
||||
(single_quote_scalar)
|
||||
(block_scalar)
|
||||
(string_scalar)
|
||||
] @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
(integer_scalar)
|
||||
(float_scalar)
|
||||
] @number
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(anchor_name)
|
||||
(alias_name)
|
||||
(tag)
|
||||
] @type
|
||||
|
||||
key: (flow_node (plain_scalar (string_scalar) @property))
|
||||
|
||||
[
|
||||
","
|
||||
"-"
|
||||
":"
|
||||
">"
|
||||
"?"
|
||||
"|"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"*"
|
||||
"&"
|
||||
"---"
|
||||
"..."
|
||||
] @punctuation.special
|
1
crates/zed/src/languages/yaml/outline.scm
Normal file
1
crates/zed/src/languages/yaml/outline.scm
Normal file
@ -0,0 +1 @@
|
||||
(block_mapping_pair key: (flow_node (plain_scalar (string_scalar) @name))) @item
|
Loading…
Reference in New Issue
Block a user