@@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
34
34
if ( ! string . Equals ( diagnostic . Id , DocumentDelegatingApiCallAnalyzer . DiagnosticId , StringComparison . Ordinal ) )
35
35
continue ;
36
36
37
- var documentRoot = await context . Document . GetSyntaxRootAsync ( context . CancellationToken ) ;
37
+ var documentRoot = await context . Document . GetSyntaxRootAsync ( context . CancellationToken ) . ConfigureAwait ( false ) ;
38
38
SyntaxNode syntax = documentRoot . FindNode ( diagnostic . Location . SourceSpan ) ;
39
39
if ( syntax == null )
40
40
continue ;
@@ -52,7 +52,7 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
52
52
{
53
53
string serviceInterfaceName = "IUnknownService" ;
54
54
string serviceExtensionsClassName = "UnknownServiceExtensions" ;
55
- INamedTypeSymbol serviceInterface = await GetServiceInterfaceAsync ( context , classDeclarationSyntax , cancellationToken ) ;
55
+ INamedTypeSymbol serviceInterface = await GetServiceInterfaceAsync ( context , classDeclarationSyntax , cancellationToken ) . ConfigureAwait ( false ) ;
56
56
if ( serviceInterface != null )
57
57
{
58
58
serviceInterfaceName = serviceInterface . MetadataName ;
@@ -72,8 +72,8 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
72
72
73
73
ClassDeclarationSyntax newClassDeclaration = classDeclarationSyntax ;
74
74
75
- ConstructorDeclarationSyntax constructor = await FindApiCallConstructorAsync ( context , classDeclarationSyntax , cancellationToken ) ;
76
- ConstructorDeclarationSyntax newConstructor = await DocumentConstructorAsync ( context , constructor , cancellationToken ) ;
75
+ ConstructorDeclarationSyntax constructor = await FindApiCallConstructorAsync ( context , classDeclarationSyntax , cancellationToken ) . ConfigureAwait ( false ) ;
76
+ ConstructorDeclarationSyntax newConstructor = await DocumentConstructorAsync ( context , constructor , cancellationToken ) . ConfigureAwait ( false ) ;
77
77
if ( newConstructor != null )
78
78
newClassDeclaration = newClassDeclaration . ReplaceNode ( constructor , newConstructor ) ;
79
79
@@ -97,7 +97,7 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
97
97
SyntaxTrivia documentationTrivia = SyntaxFactory . Trivia ( documentationComment ) ;
98
98
newClassDeclaration = newClassDeclaration . WithLeadingTrivia ( newClassDeclaration . GetLeadingTrivia ( ) . Add ( documentationTrivia ) ) ;
99
99
100
- SyntaxNode root = await context . Document . GetSyntaxRootAsync ( cancellationToken ) ;
100
+ SyntaxNode root = await context . Document . GetSyntaxRootAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
101
101
SyntaxNode newRoot = root . ReplaceNode ( classDeclarationSyntax , newClassDeclaration ) ;
102
102
return context . Document . WithSyntaxRoot ( newRoot ) ;
103
103
}
@@ -107,7 +107,7 @@ private async Task<ConstructorDeclarationSyntax> DocumentConstructorAsync(CodeFi
107
107
if ( constructor == null )
108
108
return null ;
109
109
110
- SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
110
+ SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
111
111
INamedTypeSymbol apiCallClass = semanticModel . GetDeclaredSymbol ( constructor . FirstAncestorOrSelf < ClassDeclarationSyntax > ( ) , cancellationToken ) ;
112
112
string parameterName = constructor . ParameterList . Parameters [ 0 ] . Identifier . ValueText ;
113
113
@@ -163,7 +163,7 @@ private async Task<ConstructorDeclarationSyntax> FindApiCallConstructorAsync(Cod
163
163
continue ;
164
164
165
165
if ( semanticModel == null )
166
- semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
166
+ semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
167
167
168
168
INamedTypeSymbol symbol = semanticModel . GetSymbolInfo ( parameterType , cancellationToken ) . Symbol as INamedTypeSymbol ;
169
169
if ( symbol == null || ! symbol . IsGenericType )
@@ -233,7 +233,7 @@ private string ExtractServiceName(INamedTypeSymbol serviceInterface)
233
233
234
234
private async Task < INamedTypeSymbol > GetServiceInterfaceAsync ( CodeFixContext context , ClassDeclarationSyntax classDeclarationSyntax , CancellationToken cancellationToken )
235
235
{
236
- SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
236
+ SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
237
237
INamedTypeSymbol apiCallSymbol = semanticModel . GetDeclaredSymbol ( classDeclarationSyntax , cancellationToken ) ;
238
238
foreach ( INamedTypeSymbol type in apiCallSymbol . ContainingNamespace . GetTypeMembers ( ) )
239
239
{
0 commit comments