-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for comments in oneof fields #1122
Comments
Hi @sefaphlvn ; it makes sense, including the comments would be a good idea! Iirc our comment handling code is pretty generic, i.e. once you find the maybeAddComment(options, sourceInfo, chunks, messageDesc.options?.deprecated);
// interface name should be defined to avoid import collisions
chunks.push(code`export interface ${def(fullName)} {`); ...ah, actually looks like we've got this comment in the code:
That was saying "our ts-poet [code generation library] doesn't support comments on anonymous types", which was true in ~2020 when that PR #95 was added, but ts-poet has since had a large refactoring to be "just string literals", so we really should be able to add the comments to the output now. If you could work on a PR that adds this
That would be great! Thanks! |
I saw the comment of oneOf items in the
It would be great if I could get a hint or a method? |
Hello,
I’ve been using ts-proto to generate TypeScript code from my proto files, and while the --comments=true flag works well for normal fields, it does not include JSDoc comments for oneof fields. Specifically, the comments within a oneof block in the proto files are omitted in the generated TypeScript output.
For example, consider the following oneof block in my proto file:
When I generate TypeScript code using ts-proto, the JSDoc comments for aatype and bbtype do not appear in the output. Instead, only the fields themselves are generated like this:
However, I would expect the JSDoc comments to be preserved for the fields in the oneof block, similar to how they are for regular fields.
is there any plan to cover this? Thank you
The text was updated successfully, but these errors were encountered: