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
|
@ -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(),
|
||||
)
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
name = "Proto"
|
||||
grammar = "proto"
|
||||
path_suffixes = ["proto"]
|
||||
line_comments = ["// "]
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
{ start = "(", end = ")", close = true, newline = true },
|
||||
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
{ start = "'", end = "'", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
]
|
|
@ -1,61 +0,0 @@
|
|||
[
|
||||
"syntax"
|
||||
"package"
|
||||
"option"
|
||||
"optional"
|
||||
"import"
|
||||
"service"
|
||||
"rpc"
|
||||
"returns"
|
||||
"message"
|
||||
"enum"
|
||||
"oneof"
|
||||
"repeated"
|
||||
"reserved"
|
||||
"to"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(key_type)
|
||||
(type)
|
||||
(message_name)
|
||||
(enum_name)
|
||||
(service_name)
|
||||
(rpc_name)
|
||||
(message_or_enum_type)
|
||||
] @type
|
||||
|
||||
(enum_field
|
||||
(identifier) @constant)
|
||||
|
||||
[
|
||||
(string)
|
||||
"\"proto3\""
|
||||
] @string
|
||||
|
||||
(int_lit) @number
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
"<"
|
||||
">"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
";"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
"=" @operator
|
|
@ -1,19 +0,0 @@
|
|||
(message
|
||||
"message" @context
|
||||
(message_name
|
||||
(identifier) @name)) @item
|
||||
|
||||
(service
|
||||
"service" @context
|
||||
(service_name
|
||||
(identifier) @name)) @item
|
||||
|
||||
(rpc
|
||||
"rpc" @context
|
||||
(rpc_name
|
||||
(identifier) @name)) @item
|
||||
|
||||
(enum
|
||||
"enum" @context
|
||||
(enum_name
|
||||
(identifier) @name)) @item
|
Loading…
Add table
Add a link
Reference in a new issue