Add syntax highlighting for TOML
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,15 @@
|
||||
(table
|
||||
.
|
||||
"["
|
||||
.
|
||||
(_) @name) @item
|
||||
|
||||
(table_array_element
|
||||
.
|
||||
"[["
|
||||
.
|
||||
(_) @name) @item
|
||||
|
||||
(pair
|
||||
.
|
||||
(_) @name) @item
|
||||
Reference in New Issue
Block a user