Skip to content

Commit 37be026

Browse files
Work on control flow in try/catch (#222)
* Work on control flow in try/catch * Improvements * Refactor code * Update diagnostic * Introduce diagnostic * Gray out catch block * Fix unit tests * Update CHANGELOG.md
1 parent 2dcfdaa commit 37be026

File tree

5 files changed

+263
-175
lines changed

5 files changed

+263
-175
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Adding improvements to the control flow analysis that was introduced in the last
1515
- [#212](https://github.com/marinasundstrom/CheckedExceptions/issues/212) Handle finally clause
1616
- [#217](https://github.com/marinasundstrom/CheckedExceptions/issues/217) Remove unused diagnostic
1717
- [#216](https://github.com/marinasundstrom/CheckedExceptions/issues/216) Assign categories to diagnostics
18+
- PR [#222](https://github.com/marinasundstrom/CheckedExceptions/pull/222) Work on control flow in try/catch
1819

1920
### Fixed
2021

CheckedExceptions.Tests/CSharpAnalyzerVerifier.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ await VerifyAnalyzerAsync(source, (test) =>
6363
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRedundantExceptionDeclaration);
6464
//test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdXmlDocButNoThrows);
6565
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRuleUnreachableCode);
66+
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRuleUnreachableCodeHidden);
6667

6768
test.DisabledDiagnostics.AddRange(allDiagnostics.Except(expected.Select(x => x.Id)));
6869
}
@@ -112,6 +113,7 @@ public static Task VerifyAnalyzerAsync([StringSyntax("c#-test")] string source,
112113
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRedundantTypedCatchClause);
113114
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRedundantExceptionDeclaration);
114115
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRuleUnreachableCode);
116+
test.DisabledDiagnostics.Add(CheckedExceptionsAnalyzer.DiagnosticIdRuleUnreachableCodeHidden);
115117

116118
if (executable)
117119
{

CheckedExceptions/AnalyzerReleases.Unshipped.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ THROW010 | Contract | Error | CheckedExceptionsAnalyzer
1515
THROW011 | Contract | Warning | CheckedExceptionsAnalyzer
1616
THROW012 | Contract | Warning | CheckedExceptionsAnalyzer
1717
THROW013 | Control flow | Warning | CheckedExceptionsAnalyzer
18-
THROW020 | Control flow | Hidden | CheckedExceptionsAnalyzer
18+
THROW020 | Control flow | Warning | CheckedExceptionsAnalyzer
19+
IDE001 | Control flow | Hidden | CheckedExceptionsAnalyzer

0 commit comments

Comments
 (0)