Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Nate Butler9a1a9813cbc5
diff --git a/Cargo.lock b/Cargo.lockindex 0ac6a2ee890..ec674aee2ce 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -7953,6 +7953,15 @@ dependencies = ["regex",]+[[package]]+name = "tree-sitter-bash"+version = "0.19.0"+source = "git+https://github.com/tree-sitter/tree-sitter-bash?rev=1b0321ee85701d5036c334a6f04761cdc672e64c#1b0321ee85701d5036c334a6f04761cdc672e64c"+dependencies = [+ "cc",+ "tree-sitter",+]+[[package]]name = "tree-sitter-c"version = "0.20.2"@@ -9539,6 +9548,7 @@ dependencies = ["tiny_http","toml","tree-sitter",+ "tree-sitter-bash","tree-sitter-c","tree-sitter-cpp","tree-sitter-css",diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.tomlindex 597e40161fb..fb7cd6addab 100644--- a/crates/zed/Cargo.toml+++ b/crates/zed/Cargo.toml@@ -104,6 +104,7 @@ thiserror.workspace = truetiny_http = "0.8"toml.workspace = truetree-sitter.workspace = true+tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "1b0321ee85701d5036c334a6f04761cdc672e64c" }tree-sitter-c = "0.20.1"tree-sitter-cpp = "0.20.0"tree-sitter-css = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" }diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rsindex 820f5641510..225bc4d0bce 100644--- a/crates/zed/src/languages.rs+++ b/crates/zed/src/languages.rs@@ -38,6 +38,7 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: Arc<NodeRuntime>) {languages.register(name, load_config(name), grammar, adapters, load_queries)};+ language("bash", tree_sitter_bash::language(), vec![]);language("c",tree_sitter_c::language(),diff --git a/crates/zed/src/languages/bash/brackets.scm b/crates/zed/src/languages/bash/brackets.scmnew file mode 100644index 00000000000..191fd9c084a--- /dev/null+++ b/crates/zed/src/languages/bash/brackets.scm@@ -0,0 +1,3 @@+("(" @open ")" @close)+("[" @open "]" @close)+("{" @open "}" @close)diff --git a/crates/zed/src/languages/bash/config.toml b/crates/zed/src/languages/bash/config.tomlnew file mode 100644index 00000000000..f3dcee9b73e--- /dev/null+++ b/crates/zed/src/languages/bash/config.toml@@ -0,0 +1,7 @@+name = "Shell Script"+path_suffixes = [".sh", ".bash", ".bashrc", ".bash_profile", ".bash_aliases", ".bash_logout", ".profile", ".zsh", ".zshrc", ".zshenv", ".zsh_profile", ".zsh_aliases", ".zsh_histfile", ".zlogin"]+brackets = [+ { start = "[", end = "]", close = true, newline = false },+ { start = "(", end = ")", close = true, newline = false },+ { start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },+]diff --git a/crates/zed/src/languages/bash/highlights.scm b/crates/zed/src/languages/bash/highlights.scmnew file mode 100644index 00000000000..f33a7c2d3ae--- /dev/null+++ b/crates/zed/src/languages/bash/highlights.scm@@ -0,0 +1,56 @@+[+ (string)+ (raw_string)+ (heredoc_body)+ (heredoc_start)+] @string++(command_name) @function++(variable_name) @property++[+ "case"+ "do"+ "done"+ "elif"+ "else"+ "esac"+ "export"+ "fi"+ "for"+ "function"+ "if"+ "in"+ "select"+ "then"+ "unset"+ "until"+ "while"+] @keyword++(comment) @comment++(function_definition name: (word) @function)++(file_descriptor) @number++[+ (command_substitution)+ (process_substitution)+ (expansion)+]@embedded++[+ "$"+ "&&"+ ">"+ ">>"+ "<"+ "|"+] @operator++(+ (command (_) @constant)+ (#match? @constant "^-")+)