You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
…orted diagnostic ID, i.e. no descriptor returned by SupportedDiagnostics has that ID, then throw an ArgumentException in ReportDiagnostic method. This exception would be turned into an analyzer diagnostic by the driver and reported back to the analyzer host.
Also fix a few tests that were reporting diagnostics with unsupported ID!
Handle unsupported diagnostics reported by analyzers.
Fixes#252 : If an analyzer reports a diagnostic with an unsupported diagnostic ID, i.e. no descriptor returned by SupportedDiagnostics has that ID, then throw an ArgumentException in ReportDiagnostic method. This exception would be turned into an analyzer diagnostic by the driver and reported back to the analyzer host.
Also fix a few tests that were reporting diagnostics with unsupported ID!
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:
You've already written the roslyn analyzer for this now right?
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.
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.
The text was updated successfully, but these errors were encountered: