mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Beancount syntax highlighting (#7389)
Release Notes: - Added syntax highlighting for [Beancount](https://beancount.github.io)
This commit is contained in:
parent
4195f27964
commit
e2e8e52ec4
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -8729,6 +8729,15 @@ dependencies = [
|
||||
"tree-sitter",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tree-sitter-beancount"
|
||||
version = "2.2.0"
|
||||
source = "git+https://github.com/polarmutex/tree-sitter-beancount?rev=da1bf8c6eb0ae7a97588affde7227630bcd678b6#da1bf8c6eb0ae7a97588affde7227630bcd678b6"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"tree-sitter",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tree-sitter-c"
|
||||
version = "0.20.6"
|
||||
@ -10369,6 +10378,7 @@ dependencies = [
|
||||
"toml",
|
||||
"tree-sitter",
|
||||
"tree-sitter-bash",
|
||||
"tree-sitter-beancount",
|
||||
"tree-sitter-c",
|
||||
"tree-sitter-c-sharp",
|
||||
"tree-sitter-cpp",
|
||||
|
@ -141,6 +141,7 @@ time = { version = "0.3", features = ["serde", "serde-well-known"] }
|
||||
toml = "0.5"
|
||||
tree-sitter = { version = "0.20", features = ["wasm"] }
|
||||
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "7331995b19b8f8aba2d5e26deb51d2195c18bc94" }
|
||||
tree-sitter-beancount = { git = "https://github.com/polarmutex/tree-sitter-beancount", rev = "da1bf8c6eb0ae7a97588affde7227630bcd678b6" }
|
||||
tree-sitter-c = "0.20.1"
|
||||
tree-sitter-c-sharp = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "dd5e59721a5f8dae34604060833902b882023aaf" }
|
||||
tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "f44509141e7e483323d2ec178f2d2e6c0fc041c1" }
|
||||
|
@ -108,6 +108,7 @@ thiserror.workspace = true
|
||||
tiny_http = "0.8"
|
||||
toml.workspace = true
|
||||
tree-sitter-bash.workspace = true
|
||||
tree-sitter-beancount.workspace = true
|
||||
tree-sitter-c-sharp.workspace = true
|
||||
tree-sitter-c.workspace = true
|
||||
tree-sitter-cpp.workspace = true
|
||||
|
@ -67,6 +67,7 @@ pub fn init(
|
||||
};
|
||||
|
||||
language("bash", tree_sitter_bash::language(), vec![]);
|
||||
language("beancount", tree_sitter_beancount::language(), vec![]);
|
||||
language(
|
||||
"c",
|
||||
tree_sitter_c::language(),
|
||||
|
3
crates/zed/src/languages/beancount/config.toml
Normal file
3
crates/zed/src/languages/beancount/config.toml
Normal file
@ -0,0 +1,3 @@
|
||||
name = "Beancount"
|
||||
path_suffixes = ["beancount"]
|
||||
brackets = [{ start = "\"", end = "\"", close = false, newline = false }]
|
21
crates/zed/src/languages/beancount/highlights.scm
Normal file
21
crates/zed/src/languages/beancount/highlights.scm
Normal file
@ -0,0 +1,21 @@
|
||||
(comment) @comment
|
||||
(headline) @comment
|
||||
[
|
||||
(payee)
|
||||
(narration)
|
||||
(string)
|
||||
] @string
|
||||
|
||||
(number) @number
|
||||
(date) @function
|
||||
(currency) @constant
|
||||
(account) @identifier
|
||||
|
||||
[
|
||||
(option)
|
||||
(include)
|
||||
(open)
|
||||
(balance)
|
||||
(pad)
|
||||
(close)
|
||||
] @keyword
|
Loading…
Reference in New Issue
Block a user