Extract TOML support into an extension (#9940)

This PR extracts TOML support into an extension and removes the built-in
TOML support from Zed.

There's a small workaround necessary in order for us to set the file
permissions on the `taplo` binary so that it can be run. Eventually
we'll want to build this into the extension API, but for now we're just
hard-coding it on the host side.

Release Notes:

- Removed built-in support for TOML, in favor of making it available as
an extension. The TOML extension will be suggested for download when you
open a `.toml` or `Cargo.lock` file.
This commit is contained in:
Marshall Bowers
2024-03-28 18:40:12 -04:00
committed by GitHub
parent 90cf73b746
commit d074586fbf
18 changed files with 156 additions and 142 deletions
@@ -0,0 +1,3 @@
("[" @open "]" @close)
("{" @open "}" @close)
("\"" @open "\"" @close)
@@ -0,0 +1,11 @@
name = "TOML"
grammar = "toml"
path_suffixes = ["Cargo.lock", "toml"]
line_comments = ["# "]
autoclose_before = ",]}"
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },
{ start = "'", end = "'", close = true, newline = false, not_in = ["comment", "string"] },
]
@@ -0,0 +1,37 @@
; 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
"=" @operator
[
"["
"]"
"[["
"]]"
"{"
"}"
] @punctuation.bracket
@@ -0,0 +1,15 @@
(table
.
"["
.
(_) @name) @item
(table_array_element
.
"[["
.
(_) @name) @item
(pair
.
(_) @name) @item
@@ -0,0 +1,2 @@
(comment) @comment
(string) @string
@@ -0,0 +1 @@
(pair (bare_key) "=" (_) @redact)