codejen: Update to latest codejen (#58866)

This commit is contained in:
sam boyer
2022-11-16 15:08:01 -05:00
committed by GitHub
parent 88f5ed0faf
commit c4528f9bd8
8 changed files with 17 additions and 11 deletions

View File

@ -34,12 +34,20 @@ func ForGen(rt *thema.Runtime, decl *kindsys.SomeDecl) (*DeclForGen, error) {
type DeclForGen struct {
*kindsys.SomeDecl
lin thema.Lineage
sch thema.Lineage
}
// Lineage returns the [thema.Lineage] for the underlying [kindsys.SomeDecl].
func (decl *DeclForGen) Lineage() thema.Lineage {
return decl.lin
}
// Schema returns the [thema.Schema] that a jenny should operate against, for those
// jennies that target a single schema.
func (decl *DeclForGen) Schema() thema.Lineage {
return decl.sch
}
// SlashHeaderMapper produces a FileMapper that injects a comment header onto
// a [codejen.File] indicating the main generator that produced it (via the provided
// maingen, which should be a path) and the jenny or jennies that constructed the