-
Notifications
You must be signed in to change notification settings - Fork 15
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Three format!("Field ...") call sites in the codegen produce
#[doc = "Field ..."] attributes, which prettyplease renders verbatim
as ///Field ... - no space after the slashes:
// from generated output:
///Field 1: `sentence`
pub sentence: &'a str,Standard rustdoc style is /// Field 1: ... with a space.
Why
prettyplease emits ///X for #[doc = "X"] verbatim - no space
insertion (attr.rs:35-38).
rustfmt doesn't fix it either (roundtrips doc attrs as-is). To get
/// X the doc string itself needs a leading space.
Fix
Three sites, one-character change each:
buffa-codegen/src/message.rs:1057-format!("Field ...")->
format!(" Field ...")buffa-codegen/src/view.rs:312- samebuffa-codegen/src/view.rs:322- same
For reference, connectrpc-codegen handles this with a doc_attrs()
helper that prefixes each non-blank line with a space before emitting
the #[doc = ...] attribute - worth considering if more doc-string
sites get added.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers