@@ -41,7 +41,7 @@ private static void AnalyzeNode(SyntaxNodeAnalysisContext context, INamedTypeSym
41
41
42
42
bool isAspNetCore = ! ( aspNetCoreMvcControllerType is null ) ;
43
43
44
- if ( isAspNetCore && IsAspNetCoreControllerContext ( context , aspNetCoreMvcControllerType ) )
44
+ if ( isAspNetCore && IsAspNetCoreControllerContext ( context , aspNetCoreMvcControllerType ) )
45
45
return ;
46
46
47
47
var node = ( AwaitExpressionSyntax ) context . Node ;
@@ -71,16 +71,16 @@ private static void AnalyzeNode(SyntaxNodeAnalysisContext context, INamedTypeSym
71
71
72
72
if ( Equals ( typeWithoutGenerics , AwaiterConfiguredType ) )
73
73
return ;
74
-
74
+
75
75
context . ReportDiagnostic ( Diagnostic . Create ( Rule , node . GetLocation ( ) , node . ToString ( ) ) ) ;
76
76
}
77
77
78
78
private static bool IsAspNetCoreControllerContext ( SyntaxNodeAnalysisContext context , INamedTypeSymbol aspNetCoreMvcControllerType )
79
79
{
80
- var node = context . Node ;
81
- while ( ! ( node is null ) && ! ( node is ClassDeclarationSyntax ) )
80
+ var node = context . Node ;
81
+ while ( ! ( node is null ) && ! ( node is ClassDeclarationSyntax ) )
82
82
node = node . Parent ;
83
-
83
+
84
84
var parentClass = node as ClassDeclarationSyntax ;
85
85
86
86
var baseTypes = parentClass . BaseList ? . Types . Select ( t => t . Type ) ?? Enumerable . Empty < TypeSyntax > ( ) ;
@@ -89,10 +89,10 @@ private static bool IsAspNetCoreControllerContext(SyntaxNodeAnalysisContext cont
89
89
{
90
90
var baseTypeSymbol = context . SemanticModel . GetTypeInfo ( baseType ) . Type ;
91
91
92
- if ( baseTypeSymbol is null || baseTypeSymbol . TypeKind == TypeKind . Interface )
92
+ if ( baseTypeSymbol is null || baseTypeSymbol . TypeKind == TypeKind . Interface )
93
93
continue ;
94
94
95
- if ( InheritsFrom ( baseTypeSymbol , aspNetCoreMvcControllerType ) )
95
+ if ( InheritsFrom ( baseTypeSymbol , aspNetCoreMvcControllerType ) )
96
96
return true ;
97
97
}
98
98
0 commit comments