~bigbes/tarantool-protobuf: 0666a648

lsp: annotate codec / grpc / json / wkt public surface (74c)

Phase-2 of the LSP / LLM affordance work (phase-1 landed annotations
on init.lua + lazy.lua). Adds ---@param / ---@return on the
public-surface entry points so editors and LLM assistants see typed
signatures on hover.

- codec.lua: encode_message, decode_message, encode_field,
  compile_writers, compile_readers, merge_message.
- grpc.lua: loopback, multiplex, new_stream_pair, wrap_call,
  wrap_server_stream, wrap_server_view.
- json.lua: M.encode, M.decode. New pb.JsonEncodeOpts and
  pb.JsonDecodeOpts @class blocks in _types.lua document the opts
  fields the implementation actually consults (use_proto_names,
  emit_defaults / always_emit_zero_value alias, indent;
  ignore_unknown_fields on decode).
- wkt.lua: register, lookup, any_pack, any_unpack. New
  pb.AnyMessage @class for the {type_url, value} shape.

Also corrects two pre-existing signature lies in _types.lua:

- pb.register is `(desc): pb.Descriptor`, not `(full_name, desc)` —
  the implementation has always derived the key from desc.name and
  all callers pass a single arg.
- pb.any.pack is `(desc, t, type_url_prefix?)`, not `(t, type_url)`.

Pure metadata — `just test` stays at 752 and `just test-c` at 1043.

bd-74c

Eugene Blikh <bigbes@gmail.com> — 2026-05-23 20:13:59 UTC

Commit 0666a6485f47f04c36fb0f7ff3db68d7b0406470view raw patch

Parent(s): d7b0364a

5 changed file(s)

FileStatus+
runtime/pb/_types.lua M +24 -9
runtime/pb/codec.lua M +15
runtime/pb/grpc.lua M +19
runtime/pb/json.lua M +8
runtime/pb/wkt.lua M +11