Re-add option handling; fix builtin type assertion

Now need to wait for coder3101/tree-sitter-proto#23 to land to really
sync this with upstream.
This commit is contained in:
Stefan VanBuren 2026-03-13 11:22:50 -04:00
parent d45b7245b8
commit 86745d66a3
No known key found for this signature in database
2 changed files with 20 additions and 2 deletions

View file

@ -31,6 +31,16 @@
(block_lit
(identifier) @property)
; Extension option names, e.g. option (foo.bar) = ...
(option
(full_ident
(identifier) @variable))
(option
(full_ident
(identifier)
(identifier) @variable.member))
[
"option"
"syntax"

View file

@ -19,19 +19,27 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto";
//<- @keyword.import
option (gogoproto.sizer_all) = true;
// ^^^^^^^^^ @variable
// ^^^^^^^^^ @variable.member
option (gogoproto.marshaler_all) = true;
// ^^^^^^^^^ @variable
// ^^^^^^^^^^^^^ @variable.member
option (gogoproto.unmarshaler_all.foo) = true;
// ^^^^^^^^^ @variable
// ^^^^^^^^^^^^^^^ @variable.member
// ^ @punctuation.delimiter
// ^^^ @variable.member
message LogContent
//<- @keyword.type
{
required string Key = 1;
// ^^^^^^ @type
// ^^^^^^ @type.builtin
// ^^^ @property
// ^ @operator
// ^ @number
required string Value = 2;
// ^^^^^^ @type
// ^^^^^^ @type.builtin
// ^^^^^ @property
required CustomType Value = 2;
// ^^^^^^^^ @keyword.modifier