CommunityToolkit / CommunityToolkit/dotnet

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

Open
#1,068 3 comments 8 reactions 0 assignees View on GitHub
bug :bug:
Dominant language
C#
Stars
3.8k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

### 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](https://github.com/user-attachments/assets/9877206a-e3ec-429d-9c52-2c960f354029)

![Image](https://github.com/user-attachments/assets/2396158d-fd82-4bfb-bd3f-9daa31bdc214)

![Image](https://github.com/user-attachments/assets/2b3e3410-148d-470b-aa8d-4108fe10c16e)

![Image](https://github.com/user-attachments/assets/1682541a-94e1-4ba9-b0b4-135ae28117d5)

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.