Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Protocol Buffers support into an extension #18704

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions crates/extensions_ui/src/extension_suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand Down
2 changes: 0 additions & 2 deletions crates/languages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions crates/languages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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.
//
Expand Down Expand Up @@ -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(),
)
Expand Down
11 changes: 11 additions & 0 deletions extensions/proto/extension.toml
Original file line number Diff line number Diff line change
@@ -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