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

Feature: Keep documentation of fluent members and methods #31

Open
vzam opened this issue Aug 22, 2024 · 1 comment
Open

Feature: Keep documentation of fluent members and methods #31

vzam opened this issue Aug 22, 2024 · 1 comment
Labels
enhancement New feature or request theory crafting Let's discuss ideas

Comments

@vzam
Copy link

vzam commented Aug 22, 2024

The generated classes and interfaces do not have the documentation of the specified FluentMembers and FluentMethods, would it be possible to copy that into the generated code, such that is can be displayed to the users through hints in their IDE?

@m31coding
Copy link
Owner

Hi @vzam, thank you for this suggestion! I believe it's technically possible. Conceptually, there’s the challenge of handling the documentation for FluentMembers, as their documentation strings could be written from a different perspective. For example:

[FluentApi]
public class Student
{
    /// <summary>
    /// Gets the first name.
    /// </summary>
    [FluentMember(0, "Named", 0)]
    public string FirstName { get; private set; }

    /// <summary>
    /// Gest the last name.
    /// </summary>
    [FluentMember(0, "Named", 1)]
    public string LastName { get; private set; }

   ...
}

For the builder, the documentation could look like this:

/// <summary>
/// Sets the first name and the last name.
/// </summary>
/// <param name="firstName">The first name.</param>
/// <param name="lastName">The last name.</param>
/// <returns></returns>
public static IOfAgeBornOn Named(string firstName, string lastName)
{
   ...
}.

If you or anyone else can think of other edge cases where the documentation can't simply be copied, please add them to the issue.

Best regards,
Kevin

@m31coding m31coding added enhancement New feature or request theory crafting Let's discuss ideas labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request theory crafting Let's discuss ideas
Projects
None yet
Development

No branches or pull requests

2 participants