Add syntax highlighting for TOML

This commit is contained in:
Max Brunsfeld
2022-04-21 16:39:49 -07:00
parent 0c587ae73c
commit 3a878c8d6c
8 changed files with 76 additions and 0 deletions
+5
View File
@@ -37,6 +37,11 @@ pub fn build_language_registry(login_shell_env_loaded: Task<()>) -> LanguageRegi
tree_sitter_rust::language(),
Some(Arc::new(rust::RustLspAdapter)),
),
(
"toml",
tree_sitter_toml::language(),
None, //
),
(
"tsx",
tree_sitter_typescript::language_tsx(),
@@ -0,0 +1,3 @@
("[" @open "]" @close)
("{" @open "}" @close)
("\"" @open "\"" @close)
@@ -0,0 +1,9 @@
name = "TOML"
path_suffixes = ["toml"]
line_comment = "# "
autoclose_before = ",]}"
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "\"", end = "\"", close = true, newline = false },
]
@@ -0,0 +1,33 @@
; Properties
;-----------
(bare_key) @property
(quoted_key) @property
; Literals
;---------
(boolean) @constant
(comment) @comment
(string) @string
(integer) @number
(float) @number
(offset_date_time) @string.special
(local_date_time) @string.special
(local_date) @string.special
(local_time) @string.special
; Punctuation
;------------
"." @punctuation.delimiter
"," @punctuation.delimiter
"=" @operator
"[" @punctuation.bracket
"]" @punctuation.bracket
"[[" @punctuation.bracket
"]]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket
+15
View File
@@ -0,0 +1,15 @@
(table
.
"["
.
(_) @name) @item
(table_array_element
.
"[["
.
(_) @name) @item
(pair
.
(_) @name) @item