Skip to content
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

Add attributes to override doc comments for every component of the generated code #136

Closed
Veetaha opened this issue Sep 15, 2024 · 1 comment
Assignees
Labels
feature request A new feature is requested

Comments

@Veetaha
Copy link
Collaborator

Veetaha commented Sep 15, 2024

The motivation for this feature is this reddit comment.

I propose the following attributes design:

Structs

/// Struct docs (not copied anywhere)
#[derive(bon::Builder)]
#[builder(
    builder_type(docs(
        /// Builder type docs
    )),
    start_fn(docs(
        /// Starting function docs
    )),
    finish_fn(docs(
        /// Finishing function docs
    ))
)]
struct Example {
    /// Field docs (inherited by setter by default)
    #[builder(docs(
        /// Setter docs override
    ))]
    field: i32,
}

Functions

/// Start fn docs
#[builder(
    builder_type(docs(
        /// Builder type docs
    )),
    finish_fn(docs(
        /// Finishing function docs
    ))
)]
fn example(
    /// Setter docs (always moved to the setter).
    /// Rust doesn't support docs on arguments directly otherwise
    arg: u32
) {}

A note for the community from the maintainers

Please vote on this issue by adding a 👍 reaction to help the maintainers with prioritizing it. You may add a comment describing your real use case related to this issue for us to better understand the problem domain.

@Veetaha
Copy link
Collaborator Author

Veetaha commented Oct 25, 2024

Closed by #145. This feature still requires some documentation and pending the 3.0 release, but that is tracked separately in #156

@Veetaha Veetaha closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new feature is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant