@@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
3434 if ( ! string . Equals ( diagnostic . Id , DocumentDelegatingApiCallAnalyzer . DiagnosticId , StringComparison . Ordinal ) )
3535 continue ;
3636
37- var documentRoot = await context . Document . GetSyntaxRootAsync ( context . CancellationToken ) ;
37+ var documentRoot = await context . Document . GetSyntaxRootAsync ( context . CancellationToken ) . ConfigureAwait ( false ) ;
3838 SyntaxNode syntax = documentRoot . FindNode ( diagnostic . Location . SourceSpan ) ;
3939 if ( syntax == null )
4040 continue ;
@@ -52,7 +52,7 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
5252 {
5353 string serviceInterfaceName = "IUnknownService" ;
5454 string serviceExtensionsClassName = "UnknownServiceExtensions" ;
55- INamedTypeSymbol serviceInterface = await GetServiceInterfaceAsync ( context , classDeclarationSyntax , cancellationToken ) ;
55+ INamedTypeSymbol serviceInterface = await GetServiceInterfaceAsync ( context , classDeclarationSyntax , cancellationToken ) . ConfigureAwait ( false ) ;
5656 if ( serviceInterface != null )
5757 {
5858 serviceInterfaceName = serviceInterface . MetadataName ;
@@ -72,8 +72,8 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
7272
7373 ClassDeclarationSyntax newClassDeclaration = classDeclarationSyntax ;
7474
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 ) ;
7777 if ( newConstructor != null )
7878 newClassDeclaration = newClassDeclaration . ReplaceNode ( constructor , newConstructor ) ;
7979
@@ -97,7 +97,7 @@ private async Task<Document> CreateChangedDocument(CodeFixContext context, Class
9797 SyntaxTrivia documentationTrivia = SyntaxFactory . Trivia ( documentationComment ) ;
9898 newClassDeclaration = newClassDeclaration . WithLeadingTrivia ( newClassDeclaration . GetLeadingTrivia ( ) . Add ( documentationTrivia ) ) ;
9999
100- SyntaxNode root = await context . Document . GetSyntaxRootAsync ( cancellationToken ) ;
100+ SyntaxNode root = await context . Document . GetSyntaxRootAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
101101 SyntaxNode newRoot = root . ReplaceNode ( classDeclarationSyntax , newClassDeclaration ) ;
102102 return context . Document . WithSyntaxRoot ( newRoot ) ;
103103 }
@@ -107,7 +107,7 @@ private async Task<ConstructorDeclarationSyntax> DocumentConstructorAsync(CodeFi
107107 if ( constructor == null )
108108 return null ;
109109
110- SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
110+ SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
111111 INamedTypeSymbol apiCallClass = semanticModel . GetDeclaredSymbol ( constructor . FirstAncestorOrSelf < ClassDeclarationSyntax > ( ) , cancellationToken ) ;
112112 string parameterName = constructor . ParameterList . Parameters [ 0 ] . Identifier . ValueText ;
113113
@@ -163,7 +163,7 @@ private async Task<ConstructorDeclarationSyntax> FindApiCallConstructorAsync(Cod
163163 continue ;
164164
165165 if ( semanticModel == null )
166- semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
166+ semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
167167
168168 INamedTypeSymbol symbol = semanticModel . GetSymbolInfo ( parameterType , cancellationToken ) . Symbol as INamedTypeSymbol ;
169169 if ( symbol == null || ! symbol . IsGenericType )
@@ -233,7 +233,7 @@ private string ExtractServiceName(INamedTypeSymbol serviceInterface)
233233
234234 private async Task < INamedTypeSymbol > GetServiceInterfaceAsync ( CodeFixContext context , ClassDeclarationSyntax classDeclarationSyntax , CancellationToken cancellationToken )
235235 {
236- SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) ;
236+ SemanticModel semanticModel = await context . Document . GetSemanticModelAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
237237 INamedTypeSymbol apiCallSymbol = semanticModel . GetDeclaredSymbol ( classDeclarationSyntax , cancellationToken ) ;
238238 foreach ( INamedTypeSymbol type in apiCallSymbol . ContainingNamespace . GetTypeMembers ( ) )
239239 {
0 commit comments