Autogenerated Split node for struct does not show documentation in tooltips

I’ve got the following struct.

/// <summary>
/// One contact point between two collidables.
/// </summary>
/// <param name="Source">The collidable the contact handler is attached to.</param>
/// <param name="Other">The other collidable involved in the contact.</param>
/// <param name="Point">The contact point in world space.</param>
/// <param name="Normal">The contact normal in world space, pointing away from the source.</param>
/// <param name="Depth">Penetration depth at the contact point.</param>
public readonly record struct ContactInfo(
    SBepu.CollidableComponent? Source,
    SBepu.CollidableComponent? Other,
    Vector3 Point,
    Vector3 Normal,
    float Depth)
{
    /// <summary>The collidable the contact handler is attached to.</summary>
    public SBepu.CollidableComponent? Source { get; init; } = Source;

    /// <summary>The other collidable involved in the contact.</summary>
    public SBepu.CollidableComponent? Other { get; init; } = Other;

    /// <summary>The contact point in world space.</summary>
    public Vector3 Point { get; init; } = Point;

    /// <summary>The contact normal in world space, pointing away from the source.</summary>
    public Vector3 Normal { get; init; } = Normal;

    /// <summary>Penetration depth at the contact point.</summary>
    public float Depth { get; init; } = Depth;

}

VVVV autogenerates a Split node for it which is nice but unfortunately that node does not show the documentation in the tooltips.

It works for other properties of the struct though.

I tried to “override” the autogenerated Split node by explicitly adding my own.


/// <summary>Splits the contact into its parts.</summary>
/// <param name="source">The collidable the contact handler is attached to.</param>
/// <param name="other">The other collidable involved in the contact.</param>
/// <param name="point">The contact point in world space.</param>
/// <param name="normal">The contact normal in world space, pointing away from the source.</param>
/// <param name="depth">Penetration depth at the contact point.</param>
public void Split(
    out SBepu.CollidableComponent? source,
    out SBepu.CollidableComponent? other,
    out Vector3 point,
    out Vector3 normal,
    out float depth)
{
    source = Source;
    other = Other;
    point = Point;
    normal = Normal;
    depth = Depth;
}

But this also does not work, the Nodebrowser no longer let’s me create the node. I guess because the autogenerated one and the one explicitly added have the same signature.

For now I’ve added some “dummy” parameter to the signature.

public void Split(
        out SBepu.CollidableComponent? source,
        out SBepu.CollidableComponent? other,
        out Vector3 point,
        out Vector3 normal,
        out float depth,
        [Pin(Visibility = PinVisibility.Hidden)] out ContactInfo contactInfo)
    {
        source = Source;
        other = Other;
        point = Point;
        normal = Normal;
        depth = Depth;
        contactInfo = this;
    }
}

Can the document feature be added to the autogenerated node (or a possibility to override it)?

Not sure how to fix tooltip problem you having, this is likely because, vl expects a <param> as method signature, but you can’t have param on get; set; of a property… So from codegen perspective it looks like I want to generate method foreach public prop, but I don't care how many constructors you have and witch one to check for documentation

About your second signature, its generally called an extension so it does not pollute main signature and should be something like that:

public static class MyBlaBlaBlaExtension {
   public static void Split(this MyBlaBlaBla input, out .., out .. ) {
          ///...
   }
}

That would work good as node only if it does not have allocations… The problem VL gonna call that every update (unless assigned on some method) so I generally wrap such helpers in process nodes with caching (witch also shows properly in node browser)… To create them I think you need via dragging pin out. (I think I had some problems it does not display in node browser too) but available via dragging pin…

Isn’t that what’s working here?

Not sure, need to dig on it:

/// <summary>Class summary. Shown in node browser?</summary>
public class BodyNode
{ 
    /// <summary>Ctor/method summary. Possibly shown on create?</summary>
    public BodyNode()

    /// <summary>Property summary (Doubt will be shown)</summary>
    public int TestProperty { get; set; }

    /// <summary>Method summary (Will not be shown)</summary>
    /// <param name="x">Method param will be shown on pin</param>
    public void SetX(int x) => TestProperty = x;
}

I suspect, if you hover a node it’s a summary, if you hover a pin it’s param.

Pin works too.

That operation actually stems from the C# compiler generated Deconstruct method for primary constructors on records.
Based on the C# doc the C# compiler will not do so if you define a Deconstruct method with the same parameter types.
What we’re doing is to rename that method to Split in order to follow our convention (our records are older than those of C#).
However that check also includes a check for the CompilerGeneratedAttribute - which your hand written Deconstruct will not have. You could however tell our system with the NameAttribute to call that operation Split.

We can also think of adding auto-generated code documentation to the auto generated one like in your example “Splits RECORD-NAME into its parts” - not sure though this adds much.