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

WPF0060 is dependent on newlines and whitespace #329

Open
lennartb- opened this issue Sep 8, 2021 · 1 comment
Open

WPF0060 is dependent on newlines and whitespace #329

lennartb- opened this issue Sep 8, 2021 · 1 comment

Comments

@lennartb-
Copy link

The code fix for WPF0060 produces this code:

/// <summary>Identifies the <see cref="SomeDependencyProperty"/> dependency property.</summary>
public static readonly DependencyProperty SomeDependencyPropertyProperty=
    DependencyProperty.Register(nameof(SomeDependencyProperty), typeof(bool), typeof(Whatever), new PropertyMetadata(false));

Reformatting (with R# or any other tool) to

/// <summary>
///     Identifies the <see cref="SomeDependencyProperty" /> dependency property.
/// </summary>
public static readonly DependencyProperty SomeDependencyPropertyProperty=
    DependencyProperty.Register(nameof(SomeDependencyProperty), typeof(bool), typeof(Whatever), new PropertyMetadata(false));

triggers the warning again. Even altering the whitespace from the code fix, i.e.

/// <summary> Identifies the <see cref="SomeDependencyProperty"/> dependency property. </summary>

does so.

Whitespace and Newlines shouldn't be triggering the analyzer as long as the string is correct. For comparison SA1624, which is the same for ctor documentation, allows this, as long as the text matches the one required by the analyzer.

@JohanLarsson
Copy link
Collaborator

JohanLarsson commented Sep 14, 2021

Sorry about this. While this analyzer is not very useful it was a bit of pain to write, the syntax tree for a doc comment is huge.
My thinking was I wanted single line for autogenerated doc comments to make them show as autogenerated.
Not sure when I will have time to fix this, thanks for reporting!

Workaround is to keep whitespace as the analyzer wants it or of course disable the analyzer as it is not very useful. You could set it to hidden to get the code gen but no warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants