-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Ported from TFS WorkItem: 1100829
Repro Steps:
1. Write a diagnostic analyzer with single descriptor with ID say "Rule1" returned in DiagnosticAnalyzer.SupportedDiagnostics
2. Report a diagnostic with a different ID, say "Rule2", in the analyzer
3. Start VS experimental instance with the analyzer and create a test that fires "Rule2".
Expected: "Rule2" diagnostic is filtered out as the SupportedDiagnostics didn't return a descriptor with Rule2
Actual: "Rule2" is reported. Additionally, you cannot configure "Rule2" in ruleset editor as it is not part of SupportedDiagnostics.
We should probably also write a Roslyn meta-analyzer to detect this scenario and flag the incorrect ReportDiagnostic invocation.
Revisions:
- Created By Manish Vasani (12/29/2014 11:09:34 AM)
- Edited By Srivatsn Narayanan (1/9/2015 9:56:28 AM)
You've already written the roslyn analyzer for this now right?
- Edited By Manish Vasani (1/9/2015 10:05:01 AM)
Yes, the analyzer is written, but we need to still implement the logic in the drivers to filter reported diagnostics with unsupported ID.
Without this change, the analyzer's claim that unsupported diagnostics will not be reported is invalid as we will report even unsupported diagnostic reported by analyzer.
- Edited By Srivatsn Narayanan (1/9/2015 1:01:10 PM)
Ah i misunderstood. Yes we should do that. The things stopping us from doing it before was the the compiler and the EnC analyzer were both producing diagnostics that werent reported through SupportedDiagnostics. I think we are fine on both counts now. Let's make this change.