feat(idl-v2): IDL v2 template gen from AST (askama)#1110
feat(idl-v2): IDL v2 template gen from AST (askama)#1110vobradovich merged 3 commits intomaster-idl-v2from
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {%- if extends.len() > 0 %} | ||
| extends { | ||
| {%- for ext in extends %} | ||
| {%- endfor %} |
There was a problem hiding this comment.
Render service extends entries
In the new service.askama template the extends block iterates over extends but never renders ext, so a service that inherits other services will emit extends {} with no entries. When the templates feature is used, any service inheritance information is silently dropped from generated IDL, producing incorrect output for services with non-empty extends.
Useful? React with 👍 / 👎.
| /// Another program constructor | ||
| /// (called once at the very beginning of the program lifetime) | ||
| Default(); | ||
| } |
There was a problem hiding this comment.
should be a new empty line, isn't it?
There was a problem hiding this comment.
if only for readability, does not affect the parser
| p2: ActorId, | ||
| p3: ManyVariants, | ||
| } | ||
| struct TupleStruct(u32); |
| /// Another Counter service | ||
| Counter2: Counter, | ||
| } | ||
| types { |
#[cfg_attr(feature = "templates", derive(askama::Template), template(...))]blocks soIdlDoc,ProgramUnit, andServiceUnitnow render Askama templates (idl.askama,program.askama,service.askama) when the optionaltemplatesfeature is enabled, letting these top-level AST nodes be fed directly into the templating pipelineType,StructDef,StructField, andEnumVariantto their respective template files (type.askama,struct_def.askama,field.askama,variant.askama), so nested types/events can also be rendered