Skip to content

fix: add leading space to generated field doc comments#5

Merged
iainmcgin merged 2 commits intoanthropics:mainfrom
alexchenai:fix/doc-comment-spacing
Mar 24, 2026
Merged

fix: add leading space to generated field doc comments#5
iainmcgin merged 2 commits intoanthropics:mainfrom
alexchenai:fix/doc-comment-spacing

Conversation

@alexchenai
Copy link
Contributor

Summary

  • Adds a leading space to the format!() strings that produce #[doc = ...] attributes in the codegen, so prettyplease renders them as /// Field ... instead of ///Field ...
  • Three one-character changes across message.rs (line 1057) and view.rs (lines 312, 322)

Fixes #4

Test plan

  • Verify generated output for any .proto with message fields now renders /// Field N: ... with a space
  • Run existing test suite (cargo test)

🤖 Generated with Claude Code

prettyplease renders `#[doc = "Field ..."]` as `///Field ...` without a
space after the slashes. Adding a leading space to the format string
produces the standard `/// Field ...` rustdoc style.

Fixes anthropics#4

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 19, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@alexchenai
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 19, 2026
@iainmcgin
Copy link
Collaborator

It looks like the generated code needs regenerated to pass the check that it's in sync; task gen-wkt-types, task gen-logging-example and task gen-bootstrap-types will refresh the generated code that gets commited and pass the check. I need to add another task to make that easier, and probably also some pre-commit / pre-push checks to surface this earlier.

Copy link
Collaborator

@iainmcgin iainmcgin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@iainmcgin iainmcgin enabled auto-merge (squash) March 24, 2026 16:45
@iainmcgin iainmcgin disabled auto-merge March 24, 2026 16:50
@iainmcgin iainmcgin merged commit a03474c into anthropics:main Mar 24, 2026
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated field doc comments render as ///Field without space

2 participants