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

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"

View file

@ -0,0 +1,13 @@
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"] },
]

View file

@ -0,0 +1,61 @@
[
"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

View file

@ -0,0 +1,19 @@
(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