@@ -14,18 +14,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
1414 var methodCalls = context . SyntaxProvider . CreateSyntaxProvider (
1515 predicate : static ( node , _ ) =>
1616 {
17- if ( node is
18- InvocationExpressionSyntax
17+ if ( node is InvocationExpressionSyntax
1918 {
2019 Expression : MemberAccessExpressionSyntax
2120 {
22- Name :
23- {
24- Identifier :
25- {
26- ValueText : "CreateScope" or "CreateAsyncScope"
27- }
28- }
21+ Name . Identifier . ValueText : "CreateScope" or "CreateAsyncScope"
2922 }
3023 } )
3124 {
@@ -67,9 +60,12 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
6760 var interceptorCode =
6861 ( invocationGroup . Key . ContainingTypeName , invocationGroup . Key . MethodName ) switch
6962 {
70- ( "Microsoft.Extensions.DependencyInjection.IServiceScopeFactory" , "CreateScope" ) => ScopeActivityGeneratedSource . ServiceScopeFactoryCreateScopeInterceptorCode ,
71- ( "Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions" , "CreateScope" ) => ScopeActivityGeneratedSource . ServiceProviderCreateScopeInterceptorCode ,
72- ( "Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions" , "CreateAsyncScope" ) => ScopeActivityGeneratedSource . ServiceProviderCreateScopeAsyncInterceptorCode ,
63+ ( "Microsoft.Extensions.DependencyInjection.IServiceScopeFactory" , "CreateScope" )
64+ => ScopeActivityGeneratedSource . ServiceScopeFactoryCreateScopeInterceptorCode ,
65+ ( "Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions" , "CreateScope" )
66+ => ScopeActivityGeneratedSource . ServiceProviderCreateScopeInterceptorCode ,
67+ ( "Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions" , "CreateAsyncScope" )
68+ => ScopeActivityGeneratedSource . ServiceProviderCreateScopeAsyncInterceptorCode ,
7369 _ => throw new ArgumentOutOfRangeException ( $ "{ invocationGroup . Key . MethodName } ")
7470 } ;
7571 stringBuilder . AppendLine ( interceptorCode ) ;
0 commit comments