Skip to content

Emit record ids and doc comments in runtime types - #2

Merged
happyDemon merged 2 commits into
mainfrom
type-names-and-docs
Nov 10, 2026
Merged

happyDemon merged 2 commits into
mainfrom
type-names-and-docs

Conversation

@happyDemon

Copy link
Copy Markdown
Member

Why

php-skir/runtime types can now carry the schema's record id and doc comments, so that the server's RPC Studio can show real names and documentation. The generators have to emit them.

What changes

  • The normalized model gains NormalizedRecord.recordId (<module path>:<qualified name>, as in upstream type descriptors) and optional doc on records, fields, enum constants and methods. Doc text is the compiler's plain doc.text; whitespace-only docs are dropped.
  • Enum skirType() and MethodDescriptor rendering emit recordId: and doc: as named arguments. doc: is left out when there is no doc comment.
  • New exports for the targets, which render structs themselves: phpSingleQuotedLiteral, renderDocArgument, renderRecordMetadataArguments and the SkirDoc type.

Breaking

  • NormalizedRecord.recordId is required, which breaks callers that hand-build a normalized schema.
  • Generated PHP now needs php-skir/runtime 0.2.1 or later, because of the named arguments.

Version is bumped to 0.3.0.

happyDemon and others added 2 commits November 10, 2026 22:30
…escriptors

Normalized records now carry a recordId (`<module path>:<qualified name>`,
matching upstream Skir type signatures) and records, fields, variants and
methods carry their doc comment text. Enum skirType() output always passes
recordId and passes doc when present; MethodDescriptor output passes doc
when present. Blank docs are treated as absent.

Export phpSingleQuotedLiteral, renderDocArgument and
renderRecordMetadataArguments so target adapters render the same arguments
for structs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit 49ecb9e into main Nov 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant