File tree Expand file tree Collapse file tree 2 files changed +10
-17
lines changed
Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -30,25 +30,18 @@ CancellationToken cancellationToken
3030 )
3131 {
3232 if ( ( reference . Node . Parent ? . Parent is not InvocationExpressionSyntax invocationExpression ) ||
33- ( reference . Symbol is not INamedTypeSymbol interfaceSymbol ) )
33+ ( reference . Symbol is not INamedTypeSymbol interfaceSymbol ) ||
34+ ( reference . SemanticModel . GetOperation ( invocationExpression , cancellationToken ) is not
35+ IInvocationOperation methodInvocation ) )
3436 {
3537 return null ;
3638 }
37- var semanticModel = reference . SemanticModel ! ;
38- var methodInvocation = semanticModel
39- . GetOperation ( invocationExpression , cancellationToken ) as IInvocationOperation ;
40- if ( methodInvocation is not null )
41- {
42- var isInterfaceOrMethodOpenGeneric = ! reference . IsSyntaxReferenceClosedTypeOrMethod ||
43- methodInvocation . TargetMethod . TypeArguments . Any ( static x => x is not INamedTypeSymbol ) ;
44- return new InterfaceReference
45- (
46- interfaceSymbol ,
47- methodInvocation ,
48- isInterfaceOrMethodOpenGeneric
49- ) ;
50- }
51- return null ;
39+ return new InterfaceReference
40+ (
41+ interfaceSymbol ,
42+ methodInvocation ,
43+ ! reference . IsSyntaxReferenceClosedTypeOrMethod
44+ ) ;
5245 }
5346
5447 public static InterfaceReference ? GetReference ( IInvocationOperation invocation )
Original file line number Diff line number Diff line change 1818 <PrivateAssets >all</PrivateAssets >
1919 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
2020 </PackageReference >
21- <PackageReference Include =" Monkeymoto.GeneratorUtils.GenericSymbolReferenceTree" Version =" 2 .0.1 " >
21+ <PackageReference Include =" Monkeymoto.GeneratorUtils.GenericSymbolReferenceTree" Version =" 3 .0.0 " >
2222 <PrivateAssets >all</PrivateAssets >
2323 <GeneratePathProperty >true</GeneratePathProperty >
2424 </PackageReference >
You can’t perform that action at this time.
0 commit comments