Skip to content

Commit 4d2d701

Browse files
Remove unused diagnostic #217
#217
1 parent 540b88a commit 4d2d701

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

CheckedExceptions/AnalyzerReleases.Unshipped.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ THROW010 | Usage | Error | CheckedExceptionsAnalyzer
1515
THROW011 | Usage | Warning | CheckedExceptionsAnalyzer
1616
THROW012 | Usage | Warning | CheckedExceptionsAnalyzer
1717
THROW013 | Usage | Warning | CheckedExceptionsAnalyzer
18-
THROW014 | Usage | Warning | CheckedExceptionsAnalyzer
1918
THROW020 | Usage | Hidden | CheckedExceptionsAnalyzer

CheckedExceptions/CheckedExceptionsAnalyzer.ControlFlow.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -768,13 +768,6 @@ private static void ReportRedundantCatchAll(SyntaxNodeAnalysisContext context, C
768768
catchClause.CatchKeyword.GetLocation()));
769769
}
770770

771-
private static void ReportUnreachableThrow(SyntaxNodeAnalysisContext context, SyntaxNode node)
772-
{
773-
context.ReportDiagnostic(Diagnostic.Create(
774-
RuleUnreachableThrow,
775-
node.GetLocation()));
776-
}
777-
778771
private static void ReportUnreachableCode(SyntaxNodeAnalysisContext context, SyntaxNode node)
779772
{
780773
ReportUnreachableCode(context, node.GetLocation());

CheckedExceptions/CheckedExceptionsAnalyzer.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public partial class CheckedExceptionsAnalyzer : DiagnosticAnalyzer
3333
public const string DiagnosticIdXmlDocButNoThrows = "THROW011";
3434
public const string DiagnosticIdRedundantExceptionDeclaration = "THROW012";
3535
public const string DiagnosticIdRedundantCatchAllClause = "THROW013";
36-
public const string DiagnosticIdUnreachableThrow = "THROW014";
3736
public const string DiagnosticIdRuleUnreachableCode = "THROW020";
3837

3938
public static IEnumerable<string> AllDiagnosticsIds = [DiagnosticIdUnhandled, DiagnosticIdGeneralThrows, DiagnosticIdGeneralThrow, DiagnosticIdDuplicateDeclarations, DiagnosticIdRuleUnreachableCode];
@@ -159,15 +158,6 @@ public partial class CheckedExceptionsAnalyzer : DiagnosticAnalyzer
159158
isEnabledByDefault: true,
160159
description: "Detects exception types declared with [Throws] that are never thrown in the method or property body, making the declaration redundant.");
161160

162-
private static readonly DiagnosticDescriptor RuleUnreachableThrow = new(
163-
DiagnosticIdUnreachableThrow,
164-
title: "Unreachable throw statement",
165-
messageFormat: "The throwing site is unreachable in the current control flow",
166-
category: "Usage",
167-
defaultSeverity: DiagnosticSeverity.Warning,
168-
isEnabledByDefault: true,
169-
description: "Detects throw statements that cannot be reached due to surrounding control flow or exception handling.");
170-
171161
private static readonly DiagnosticDescriptor RuleUnreachableCode = new(
172162
DiagnosticIdRuleUnreachableCode,
173163
title: "Unreachable code",
@@ -179,7 +169,7 @@ public partial class CheckedExceptionsAnalyzer : DiagnosticAnalyzer
179169
customTags: [WellKnownDiagnosticTags.Unnecessary]);
180170

181171
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>
182-
[RuleUnhandledException, RuleIgnoredException, RuleGeneralThrows, RuleGeneralThrow, RuleDuplicateDeclarations, RuleMissingThrowsOnBaseMember, RuleMissingThrowsFromBaseMember, RuleDuplicateThrowsByHierarchy, RuleRedundantTypedCatchClause, RuleRedundantCatchAllClause, RuleThrowsDeclarationNotValidOnFullProperty, RuleXmlDocButNoThrows, RuleRedundantExceptionDeclaration, RuleUnreachableThrow, RuleUnreachableCode];
172+
[RuleUnhandledException, RuleIgnoredException, RuleGeneralThrows, RuleGeneralThrow, RuleDuplicateDeclarations, RuleMissingThrowsOnBaseMember, RuleMissingThrowsFromBaseMember, RuleDuplicateThrowsByHierarchy, RuleRedundantTypedCatchClause, RuleRedundantCatchAllClause, RuleThrowsDeclarationNotValidOnFullProperty, RuleXmlDocButNoThrows, RuleRedundantExceptionDeclaration, RuleUnreachableCode];
183173

184174
public override void Initialize(AnalysisContext context)
185175
{

0 commit comments

Comments
 (0)