protected override SyntaxNode RemoveAsyncTokenAndFixReturnType( IMethodSymbol methodSymbolOpt, SyntaxNode node, KnownTypes knownTypes ) { switch (node) { case MethodDeclarationSyntax method: return(FixMethod(methodSymbolOpt, method, knownTypes)); case LocalFunctionStatementSyntax localFunction: return(FixLocalFunction(methodSymbolOpt, localFunction, knownTypes)); case AnonymousMethodExpressionSyntax method: return(RemoveAsyncModifierHelpers.WithoutAsyncModifier(method)); case ParenthesizedLambdaExpressionSyntax lambda: return(RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda)); case SimpleLambdaExpressionSyntax lambda: return(RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda)); default: return(node); } }
private static SyntaxNode FixMethod( IMethodSymbol methodSymbol, MethodDeclarationSyntax method, KnownTypes knownTypes ) { var newReturnType = FixMethodReturnType(methodSymbol, method.ReturnType, knownTypes); return(RemoveAsyncModifierHelpers.WithoutAsyncModifier(method, newReturnType)); }
private static SyntaxNode FixLocalFunction( IMethodSymbol methodSymbol, LocalFunctionStatementSyntax localFunction, KnownTypes knownTypes ) { var newReturnType = FixMethodReturnType( methodSymbol, localFunction.ReturnType, knownTypes ); return(RemoveAsyncModifierHelpers.WithoutAsyncModifier(localFunction, newReturnType)); }