Skip to content

[Bug]: XML documentation is not propagated to generated members for [Reactive] partial properties and [ReactiveCommand] #375

@formular2

Description

@formular2

Describe the bug 🐞

Hello,

I noticed that XML documentation comments (///

) are not being propagated or inherited correctly when using the Source Generators in specific scenarios.

While XML documentation works correctly when tagging a private field with [Reactive], it fails to appear in IntelliSense for external callers when using:

  1. [Reactive] on a partial property.

  2. [ReactiveCommand] on a method.

This makes it difficult to provide documentation for the public API of the ViewModels when using these modern syntax styles.

Step to reproduce

Here is a comparison of the scenarios:

public partial class MyViewModel : ReactiveObject
{
    // ✅ SCENARIO 1: Private Field (WORKS)
    // The generated "Title" property correctly shows this summary in IntelliSense.
    /// <summary>
    /// This is the page title. (Visible in IntelliSense)
    /// </summary>
    [Reactive]
    private string _title;

    // ❌ SCENARIO 2: Partial Property (FAILS)
    // The generated implementation does not inherit this summary.
    // External callers see no documentation for "TotalPages".
    /// <summary>
    /// Total number of pages. (NOT Visible in IntelliSense)
    /// </summary>
    [Reactive]
    public partial int TotalPages { get; set; }

    // ❌ SCENARIO 3: ReactiveCommand (FAILS)
    // The generated "SaveCommand" property does not inherit this summary.
    /// <summary>
    /// Saves the current document. (NOT Visible on SaveCommand)
    /// </summary>
    [ReactiveCommand]
    private void Save()
    {
        // Implementation
    }
}

Reproduction repository

https://github.com/reactiveui/ReactiveUI.SourceGenerators

Expected behavior

  • For Partial Properties: The generated implementation should ideally inherit the XML documentation (e.g., via ) so that IntelliSense displays the comments defined on the partial definition.

  • For ReactiveCommands: The generated PublicCommand property should copy the XML documentation from the annotated private method.

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows10

Version

Framework: .NET 10; ReactiveUI.SourceGenerators Version: 2.6.1

Device

PC

ReactiveUI Version

No response

Additional information ℹ️

Comparatively, [Reactive] on private fields works as expected. It would be great if partial properties and commands could have consistent behavior regarding documentation.

Thanks for your work on this library!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions