Skip to content

Emit record ids and doc comments in generated types - #3

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 0.2.1 lets a type carry the schema's record id and doc comments, and php-skir/server 0.3.1 shows them in the RPC Studio. Until the generated code provides them, the Studio has to invent record names.

What changes

  • Struct skirType() emits recordId: '<module path>:<qualified name>' and, where the schema has a doc comment, doc: on the record and on its fields. An empty struct gets its record id too.
  • Enums and method descriptors get the same through @php-skir/generator-core 0.3.0, which this now depends on.
  • The integration test compiles a schema with doc comments, a nested enum and a nested empty struct, and reads the metadata back from the runtime descriptors.

Breaking

Generated PHP uses named arguments that exist from php-skir/runtime 0.2.1, so projects must update the runtime when they regenerate. The README install line says so.

Version is bumped to 0.3.0.

happyDemon and others added 2 commits November 10, 2026 22:28
Struct skirType() output now always passes recordId to Type::struct()
(including empty structs) and passes doc for documented records and
fields, using the metadata helpers from @php-skir/generator-core. Enum and
method descriptor metadata comes from the core renderers.

Requires a @php-skir/generator-core release that exports
renderDocArgument and renderRecordMetadataArguments, and a php-skir/runtime
that accepts the recordId and doc arguments.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Generated types carry their record id and doc comments, which needs
php-skir/runtime 0.2.1 or later.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit bf99064 into main Nov 10, 2026
4 checks passed
@happyDemon
happyDemon deleted the type-names-and-docs branch November 10, 2026 21:42
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