Extract Protocol Buffers support into an extension (#18704)

This PR extracts the Protocol Buffers support into an extension.

Release Notes:

- Removed built-in support for Protocol Buffers, in favor of making it
available as an extension. The Protocol Buffers extension will be
suggested for download when you open a `.proto` file.
This commit is contained in:
Marshall Bowers 2024-10-03 13:37:43 -04:00 committed by GitHub
parent 8c95b8d89a
commit cddd7875a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 13 additions and 16 deletions

10
Cargo.lock generated
View file

@ -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"

View file

@ -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"

View file

@ -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"]),

View file

@ -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 = true
node_runtime.workspace = true
paths.workspace = true
project.workspace = true
protols-tree-sitter-proto = { workspace = true, optional = true }
regex.workspace = true
rope.workspace = true
rust-embed.workspace = true

View file

@ -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(),
)

View file

@ -0,0 +1,11 @@
id = "proto"
name = "Proto"
description = "Protocol Buffers support."
version = "0.1.0"
schema_version = 1
authors = ["Zed Industries <support@zed.dev>"]
repository = "https://github.com/zed-industries/zed"
[grammars.proto]
repository = "https://github.com/zed-industries/tree-sitter-proto"
commit = "0848bd30a64be48772e15fbb9d5ba8c0cc5772ad"