Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fully qualified name to cref ObservableObject in xml comments for files generated by ObservableObjectGenerator #963

Open
1 of 4 tasks
RobGess opened this issue Oct 21, 2024 · 0 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@RobGess
Copy link

RobGess commented Oct 21, 2024

Describe the bug

When using the ObservableObject attribute from the CommunityToolkit.Mvvm v8.3.2 package on the code behind partial class of a WPF UserControl like this:

Image

The reference <see cref = "ObservableObject"/> symbol reference is not resolved in the *.g.cs file generated by the ObservableObjectGenerator.

Image

First, I opened a ticket in the DocFx project because I found this issue working with DocFx. Analyzing the problem with a contributor from the DocFx team, I was sent over here.

How to fix problem
ObservableObject should be referenced by using fully qualified name.
(e,g, <see cref = "global::CommunityToolkit.Mvvm.ComponentModel.ObservableObject"/>)

It probably can be fixed by changing following line.
https://github.com/CommunityToolkit/dotnet/blob/v8.3.2/src/CommunityToolkit.Mvvm/ComponentModel/ObservableObject.cs#L275

Regression

No response

Steps to reproduce

Have a look at my test project DocFxTest to reproduce this issue or follow these steps:

  1. Create WPF project.
  2. Add UserControl
  3. Add [ObservableObject] attribute to partial class *.xaml.cs of the UserControl.
  4. Check SourceGenerator's *.g.cs file's SetProperty method's comments.

Expected behavior

Symbol should be resolved (and highlighted).

Screenshots

No response

IDE and version

VS 2022

IDE version

17.11.5

Nuget packages

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

Nuget package version(s)

8.3.2

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

@RobGess RobGess added the bug 🐛 An unexpected issue that highlights incorrect behavior label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

No branches or pull requests

1 participant