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

Verify doesn't allow diagnostics with the same id #253

Closed
manfred-brands opened this issue Apr 1, 2022 · 3 comments · Fixed by #255
Closed

Verify doesn't allow diagnostics with the same id #253

manfred-brands opened this issue Apr 1, 2022 · 3 comments · Fixed by #255

Comments

@manfred-brands
Copy link
Contributor

This is the same as #99 which was then solved by the writer to make all id's unique.

I ran into this again with another Analyzer.
Looking at the Roslyn analyzer they also use multiple DiagnosticsDescriptors with the same Id, just with different message/title.
See:

There are several others.

So I think the Unique test in RoslynAssert.cs VerifyAnalyzerSupportsDiagnostic should be removed.

Currently ExpectedDiagnostic only works on the RuleId, maybe it should work on DiagnosticDescriptor instead which then needs to be one listed in the SupportedDiagnostics.

@JohanLarsson
Copy link
Member

This should also have been a separate pull request.

@manfred-brands
Copy link
Contributor Author

I offered to split it off. Didn't expect it to be accepted straight away.

@JohanLarsson
Copy link
Member

Ok, no worries.
Just wanted to put my foot down in case it was designed as hidden cargo in the PR :D

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

Successfully merging a pull request may close this issue.

2 participants