Esempio n. 1
0
        public override Task <IMethodSymbol?> TryGetBestMatchAsync(Project project,
                                                                   INamedTypeSymbol type,
                                                                   StackFrameSimpleNameNode methodNode,
                                                                   StackFrameParameterList methodArguments,
                                                                   StackFrameTypeArgumentList?methodTypeArguments,
                                                                   CancellationToken cancellationToken)
        {
            var methodName = methodNode.ToString();

            var candidateMethods = type
                                   .GetMembers()
                                   .OfType <IMethodSymbol>()
                                   .Where(m => m.Name == methodName)
                                   .ToImmutableArray();

            var match = TryGetBestMatch(candidateMethods, methodTypeArguments, methodArguments);

            return(Task.FromResult(match));
        }