M31.FluentAPI icon indicating copy to clipboard operation
M31.FluentAPI copied to clipboard

Feature: Keep documentation of fluent members and methods

Open vzam opened this issue 1 year ago • 3 comments

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?

vzam avatar Aug 22 '24 07:08 vzam

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 avatar Sep 20 '24 06:09 m31coding

Is this feature being worked on at the moment?

dg-yv avatar Apr 10 '25 09:04 dg-yv

Thanks for the ping! I currently don't have the capacity to work on that feature, but I’m planning to implement it in Q3.

m31coding avatar Apr 26 '25 13:04 m31coding