@@ -351,7 +351,7 @@ private void AnalyzeExceptionsInTryBlock(SyntaxNodeAnalysisContext context, TryS
351351 if ( ShouldIgnore ( throwStatement , mode ) )
352352 {
353353 // Report as THROW002 (Info level)
354- var diagnostic = Diagnostic . Create ( RuleIgnoredException , throwStatement . GetLocation ( ) , exceptionType . Name ) ;
354+ var diagnostic = Diagnostic . Create ( RuleIgnoredException , GetSignificantLocation ( throwStatement ) , exceptionType . Name ) ;
355355 context . ReportDiagnostic ( diagnostic ) ;
356356 continue ;
357357 }
@@ -368,7 +368,7 @@ private void AnalyzeExceptionsInTryBlock(SyntaxNodeAnalysisContext context, TryS
368368 // Report diagnostic for unhandled exception
369369 var diagnostic = Diagnostic . Create (
370370 RuleUnhandledException ,
371- throwStatement . GetLocation ( ) ,
371+ GetSignificantLocation ( throwStatement ) ,
372372 exceptionType . Name ,
373373 THROW001Verbs . MightBe ) ;
374374
@@ -1195,7 +1195,7 @@ private void AnalyzeExceptionThrowingNode(
11951195 if ( ShouldIgnore ( node , mode ) )
11961196 {
11971197 // Report as THROW002 (Info level)
1198- var diagnostic = Diagnostic . Create ( RuleIgnoredException , node . GetLocation ( ) , exceptionType . Name ) ;
1198+ var diagnostic = Diagnostic . Create ( RuleIgnoredException , GetSignificantLocation ( node ) , exceptionType . Name ) ;
11991199 context . ReportDiagnostic ( diagnostic ) ;
12001200 return ;
12011201 }
@@ -1204,7 +1204,7 @@ private void AnalyzeExceptionThrowingNode(
12041204 // Check for general exceptions
12051205 if ( IsGeneralException ( exceptionType ) )
12061206 {
1207- context . ReportDiagnostic ( Diagnostic . Create ( RuleGeneralThrow , node . GetLocation ( ) ) ) ;
1207+ context . ReportDiagnostic ( Diagnostic . Create ( RuleGeneralThrow , GetSignificantLocation ( node ) ) ) ;
12081208 }
12091209
12101210 // Check if the exception is declared via [Throws]
@@ -1223,7 +1223,7 @@ private void AnalyzeExceptionThrowingNode(
12231223
12241224 var verb = isThrowingConstruct ? THROW001Verbs . Is : THROW001Verbs . MightBe ;
12251225
1226- var diagnostic = Diagnostic . Create ( RuleUnhandledException , node . GetLocation ( ) , properties , exceptionType . Name , verb ) ;
1226+ var diagnostic = Diagnostic . Create ( RuleUnhandledException , GetSignificantLocation ( node ) , properties , exceptionType . Name , verb ) ;
12271227 context . ReportDiagnostic ( diagnostic ) ;
12281228 }
12291229 }
0 commit comments