wip yaml highlighting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
("[" @open "]" @close)
|
||||
("{" @open "}" @close)
|
||||
("\"" @open "\"" @close)
|
||||
@@ -0,0 +1,15 @@
|
||||
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 },
|
||||
]
|
||||
|
||||
[overrides.string]
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
(boolean_scalar) @boolean
|
||||
(null_scalar) @constant.builtin
|
||||
(double_quote_scalar) @string
|
||||
(single_quote_scalar) @string
|
||||
((block_scalar) @string (#set! "priority" 99))
|
||||
(string_scalar) @string
|
||||
(escape_sequence) @string.escape
|
||||
(integer_scalar) @number
|
||||
(float_scalar) @number
|
||||
(comment) @comment
|
||||
(anchor_name) @type
|
||||
(alias_name) @type
|
||||
(tag) @type
|
||||
(ERROR) @error
|
||||
|
||||
[
|
||||
","
|
||||
"-"
|
||||
":"
|
||||
">"
|
||||
"?"
|
||||
"|"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"*"
|
||||
"&"
|
||||
"---"
|
||||
"..."
|
||||
] @punctuation.special
|
||||
Reference in New Issue
Block a user