diff --git a/runtime/queries/proto/highlights.scm b/runtime/queries/proto/highlights.scm index 9175d8ebc..98b4db4ae 100644 --- a/runtime/queries/proto/highlights.scm +++ b/runtime/queries/proto/highlights.scm @@ -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" diff --git a/tests/query/highlights/proto/test.proto b/tests/query/highlights/proto/test.proto index f037d8ef3..7f8c3abdf 100644 --- a/tests/query/highlights/proto/test.proto +++ b/tests/query/highlights/proto/test.proto @@ -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