Skip to content

Fix doc comment space in generated field docs#16

Open
kostakost2 wants to merge 1 commit intoanthropics:mainfrom
kostakost2:fix-doc-comment-space
Open

Fix doc comment space in generated field docs#16
kostakost2 wants to merge 1 commit intoanthropics:mainfrom
kostakost2:fix-doc-comment-space

Conversation

@kostakost2
Copy link
Copy Markdown

Fixes #4.

Problem

prettyplease renders #[doc = "X"] verbatim as ///X — no space after the slashes. This produces generated output like:

///Field 1: `sentence`
pub sentence: &'a str,

Fix

Prepend a single space to the three field doc format strings in the codegen so the emitted #[doc = " Field ..."] renders as /// Field ... per rustdoc convention.

// before
let tag_line = format!("Field {field_number}: `{field_name}`");

// after  
let tag_line = format!(" Field {field_number}: `{field_name}`");

Three sites changed: message.rs:1062, view.rs:318, view.rs:329.

cargo build --package buffa-codegen passes. Full test suite requires protoc which is unavailable in my environment, but the changes are mechanical and self-contained.

Fixes anthropics#4. prettyplease renders `#[doc = "X"]` as `///X` verbatim
(no space insertion). By prepending a space to the three field doc
format strings the generated output becomes `/// X` per rustdoc style.

Three one-character changes:
- buffa-codegen/src/message.rs: field doc line
- buffa-codegen/src/view.rs: map field doc line
- buffa-codegen/src/view.rs: regular field doc line
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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


Claude Lab seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

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

1 participant