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:
parent
8c95b8d89a
commit
cddd7875a4
9 changed files with 13 additions and 16 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -6386,7 +6386,6 @@ dependencies = [
|
||||||
"node_runtime",
|
"node_runtime",
|
||||||
"paths",
|
"paths",
|
||||||
"project",
|
"project",
|
||||||
"protols-tree-sitter-proto",
|
|
||||||
"regex",
|
"regex",
|
||||||
"rope",
|
"rope",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
|
@ -8644,15 +8643,6 @@ version = "2.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
|
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]]
|
[[package]]
|
||||||
name = "psm"
|
name = "psm"
|
||||||
version = "0.1.21"
|
version = "0.1.21"
|
||||||
|
|
|
@ -388,7 +388,6 @@ profiling = "1"
|
||||||
prost = "0.9"
|
prost = "0.9"
|
||||||
prost-build = "0.9"
|
prost-build = "0.9"
|
||||||
prost-types = "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 }
|
pulldown-cmark = { version = "0.12.0", default-features = false }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
regex = "1.5"
|
regex = "1.5"
|
||||||
|
|
|
@ -54,6 +54,7 @@ const SUGGESTIONS_BY_EXTENSION_ID: &[(&str, &[&str])] = &[
|
||||||
("ocaml", &["ml", "mli"]),
|
("ocaml", &["ml", "mli"]),
|
||||||
("php", &["php"]),
|
("php", &["php"]),
|
||||||
("prisma", &["prisma"]),
|
("prisma", &["prisma"]),
|
||||||
|
("proto", &["proto"]),
|
||||||
("purescript", &["purs"]),
|
("purescript", &["purs"]),
|
||||||
("r", &["r", "R"]),
|
("r", &["r", "R"]),
|
||||||
("racket", &["rkt"]),
|
("racket", &["rkt"]),
|
||||||
|
|
|
@ -21,7 +21,6 @@ load-grammars = [
|
||||||
"tree-sitter-jsdoc",
|
"tree-sitter-jsdoc",
|
||||||
"tree-sitter-json",
|
"tree-sitter-json",
|
||||||
"tree-sitter-md",
|
"tree-sitter-md",
|
||||||
"protols-tree-sitter-proto",
|
|
||||||
"tree-sitter-python",
|
"tree-sitter-python",
|
||||||
"tree-sitter-regex",
|
"tree-sitter-regex",
|
||||||
"tree-sitter-rust",
|
"tree-sitter-rust",
|
||||||
|
@ -46,7 +45,6 @@ lsp.workspace = true
|
||||||
node_runtime.workspace = true
|
node_runtime.workspace = true
|
||||||
paths.workspace = true
|
paths.workspace = true
|
||||||
project.workspace = true
|
project.workspace = true
|
||||||
protols-tree-sitter-proto = { workspace = true, optional = true }
|
|
||||||
regex.workspace = true
|
regex.workspace = true
|
||||||
rope.workspace = true
|
rope.workspace = true
|
||||||
rust-embed.workspace = true
|
rust-embed.workspace = true
|
||||||
|
|
|
@ -45,7 +45,6 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: NodeRuntime, cx: &mu
|
||||||
("jsonc", tree_sitter_json::LANGUAGE),
|
("jsonc", tree_sitter_json::LANGUAGE),
|
||||||
("markdown", tree_sitter_md::LANGUAGE),
|
("markdown", tree_sitter_md::LANGUAGE),
|
||||||
("markdown-inline", tree_sitter_md::INLINE_LANGUAGE),
|
("markdown-inline", tree_sitter_md::INLINE_LANGUAGE),
|
||||||
("proto", protols_tree_sitter_proto::LANGUAGE),
|
|
||||||
("python", tree_sitter_python::LANGUAGE),
|
("python", tree_sitter_python::LANGUAGE),
|
||||||
("regex", tree_sitter_regex::LANGUAGE),
|
("regex", tree_sitter_regex::LANGUAGE),
|
||||||
("rust", tree_sitter_rust::LANGUAGE),
|
("rust", tree_sitter_rust::LANGUAGE),
|
||||||
|
@ -183,7 +182,6 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: NodeRuntime, cx: &mu
|
||||||
"yaml",
|
"yaml",
|
||||||
vec![Arc::new(yaml::YamlLspAdapter::new(node_runtime.clone()))]
|
vec![Arc::new(yaml::YamlLspAdapter::new(node_runtime.clone()))]
|
||||||
);
|
);
|
||||||
language!("proto");
|
|
||||||
|
|
||||||
// Register globally available language servers.
|
// 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 {
|
fn load_config(name: &str) -> LanguageConfig {
|
||||||
let config_toml = String::from_utf8(
|
let config_toml = String::from_utf8(
|
||||||
LanguageDir::get(&format!("{}/config.toml", name))
|
LanguageDir::get(&format!("{}/config.toml", name))
|
||||||
.unwrap()
|
.unwrap_or_else(|| panic!("missing config for language {:?}", name))
|
||||||
.data
|
.data
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
)
|
)
|
||||||
|
|
11
extensions/proto/extension.toml
Normal file
11
extensions/proto/extension.toml
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue