Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Extract Protocol Buffers support into an extension (#18704)
Marshall Bowerscddd7875a42c
diff --git a/Cargo.lock b/Cargo.lockindex 0a14f04f892..12b38967cc3 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -6386,7 +6386,6 @@ dependencies = ["node_runtime","paths","project",- "protols-tree-sitter-proto","regex","rope","rust-embed",@@ -8644,15 +8643,6 @@ version = "2.28.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"-[[package]]-name = "protols-tree-sitter-proto"-version = "0.2.0"-source = "git+https://github.com/zed-industries/tree-sitter-proto?rev=0848bd30a64be48772e15fbb9d5ba8c0cc5772ad#0848bd30a64be48772e15fbb9d5ba8c0cc5772ad"-dependencies = [- "cc",- "tree-sitter-language",-]-[[package]]name = "psm"version = "0.1.21"diff --git a/Cargo.toml b/Cargo.tomlindex 8feb93a5785..a23663f5c81 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -388,7 +388,6 @@ profiling = "1"prost = "0.9"prost-build = "0.9"prost-types = "0.9"-protols-tree-sitter-proto = { git = "https://github.com/zed-industries/tree-sitter-proto", rev = "0848bd30a64be48772e15fbb9d5ba8c0cc5772ad" }pulldown-cmark = { version = "0.12.0", default-features = false }rand = "0.8.5"regex = "1.5"diff --git a/crates/extensions_ui/src/extension_suggest.rs b/crates/extensions_ui/src/extension_suggest.rsindex 89f51fdebcf..ed003f25b7f 100644--- a/crates/extensions_ui/src/extension_suggest.rs+++ b/crates/extensions_ui/src/extension_suggest.rs@@ -54,6 +54,7 @@ const SUGGESTIONS_BY_EXTENSION_ID: &[(&str, &[&str])] = &[("ocaml", &["ml", "mli"]),("php", &["php"]),("prisma", &["prisma"]),+ ("proto", &["proto"]),("purescript", &["purs"]),("r", &["r", "R"]),("racket", &["rkt"]),diff --git a/crates/languages/Cargo.toml b/crates/languages/Cargo.tomlindex 19842efac20..dc7868ea86d 100644--- a/crates/languages/Cargo.toml+++ b/crates/languages/Cargo.toml@@ -21,7 +21,6 @@ load-grammars = ["tree-sitter-jsdoc","tree-sitter-json","tree-sitter-md",- "protols-tree-sitter-proto","tree-sitter-python","tree-sitter-regex","tree-sitter-rust",@@ -46,7 +45,6 @@ lsp.workspace = truenode_runtime.workspace = truepaths.workspace = trueproject.workspace = true-protols-tree-sitter-proto = { workspace = true, optional = true }regex.workspace = truerope.workspace = truerust-embed.workspace = truediff --git a/crates/languages/src/lib.rs b/crates/languages/src/lib.rsindex 295df6e419b..374b32c0ac3 100644--- a/crates/languages/src/lib.rs+++ b/crates/languages/src/lib.rs@@ -45,7 +45,6 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: NodeRuntime, cx: &mu("jsonc", tree_sitter_json::LANGUAGE),("markdown", tree_sitter_md::LANGUAGE),("markdown-inline", tree_sitter_md::INLINE_LANGUAGE),- ("proto", protols_tree_sitter_proto::LANGUAGE),("python", tree_sitter_python::LANGUAGE),("regex", tree_sitter_regex::LANGUAGE),("rust", tree_sitter_rust::LANGUAGE),@@ -183,7 +182,6 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: NodeRuntime, cx: &mu"yaml",vec![Arc::new(yaml::YamlLspAdapter::new(node_runtime.clone()))]);- language!("proto");// Register globally available language servers.//@@ -277,7 +275,7 @@ pub fn language(name: &str, grammar: tree_sitter::Language) -> Arc<Language> {fn load_config(name: &str) -> LanguageConfig {let config_toml = String::from_utf8(LanguageDir::get(&format!("{}/config.toml", name))- .unwrap()+ .unwrap_or_else(|| panic!("missing config for language {:?}", name)).data.to_vec(),)diff --git a/extensions/proto/extension.toml b/extensions/proto/extension.tomlnew file mode 100644index 00000000000..a49ba7a4c4a--- /dev/null+++ b/extensions/proto/extension.toml@@ -0,0 +1,11 @@+id = "proto"+name = "Proto"+description = "Protocol Buffers support."+version = "0.1.0"+schema_version = 1+authors = ["Zed Industries <[email protected]>"]+repository = "https://github.com/zed-industries/zed"++[grammars.proto]+repository = "https://github.com/zed-industries/tree-sitter-proto"+commit = "0848bd30a64be48772e15fbb9d5ba8c0cc5772ad"diff --git a/crates/languages/src/proto/config.toml b/extensions/proto/languages/proto/config.tomlsimilarity index 100%rename from crates/languages/src/proto/config.tomlrename to extensions/proto/languages/proto/config.tomldiff --git a/crates/languages/src/proto/highlights.scm b/extensions/proto/languages/proto/highlights.scmsimilarity index 100%rename from crates/languages/src/proto/highlights.scmrename to extensions/proto/languages/proto/highlights.scmdiff --git a/crates/languages/src/proto/outline.scm b/extensions/proto/languages/proto/outline.scmsimilarity index 100%rename from crates/languages/src/proto/outline.scmrename to extensions/proto/languages/proto/outline.scm