dotnet icon indicating copy to clipboard operation
dotnet copied to clipboard

<inheritdoc/> should not be used on partial properties.

Open Kevin-Seiden opened this issue 11 months ago • 0 comments

Describe the bug

The inheritdoc xml documentation tag is designed for derived members. Partial properties are not derived members, they are implementations. By including this tag on partial properties, comments added by the developer to an [ObservableProperty] adorned partial property will not show their documentation in Visual Studio IntelliSense windows.

While this may be debatable that it is an issue with Visual Studio, I'm inclined to think that partial properties are not derived, and therefore the tag is inappropriate. I've also noticed this confuses other packages, like StyleCop Analyzers. The rules for requiring documentation in that package no longer show over [ObservableProperty]s because it sees the inheritdoc tag and assumes it is documented.

I've included screenshots demonstrating the problem, as well as screenshots without CommunityToolkit.MVVM that prove it is the inheritdoc tag at fault.

Regression

No response

Steps to reproduce

  1. Create an [ObservableProperty] using partial property method with the new C# preview features while using Visual Studio.
  2. Add XML documentation to the property.
  3. Build/make sure the generator has run.
  4. Hover the mouse over the property name, notice the missing documentation.

Expected behavior

Generated partial properties should not interfere with IntelliSense.

Screenshots

Image

Image

Image

Image

IDE and version

VS 2022 Preview

IDE version

17.13.4

Nuget packages

  • [ ] CommunityToolkit.Common
  • [ ] CommunityToolkit.Diagnostics
  • [ ] CommunityToolkit.HighPerformance
  • [x] CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.4.0

Additional context

No response

Help us help you

No, just wanted to report this

Kevin-Seiden avatar Mar 21 '25 16:03 Kevin-Seiden