public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query) { IEnumerable <IMethodSymbol> methodSymbols; // Check if type is set (no type => get all methods) if (!(query.Type is null)) { // Get all methods of the type ITypeSymbol type = GetTypeFromSpecifier(query.Type); if (type == null) { return(new MethodSpecifier[0]); } methodSymbols = type.GetMethods(); }
public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query) { IEnumerable <IMethodSymbol> methodSymbols; // Check if type is set (no type => get all methods) if (!(query.Type is null)) { // Get all methods of the type ITypeSymbol type = GetTypeFromSpecifier(query.Type); if (type == null) { return(new MethodSpecifier[0]); } methodSymbols = type.GetMethods(); var extensions = extensionMethods.Where(m => type.IsSubclassOf(m.Parameters[0].Type)).ToList(); // Add applicable extension methods methodSymbols = methodSymbols.Concat(extensions); }
public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query) => memoizedGetMethods(query);