private static void AnalyzeReturnStatement(SyntaxNodeAnalysisContext context) { MergeLocalDeclarationWithReturnStatementRefactoring.Analyze(context); var returnStatement = (ReturnStatementSyntax)context.Node; ReplaceReturnStatementWithExpressionStatementRefactoring.Analyze(context, returnStatement); }
public override void Initialize(AnalysisContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } base.Initialize(context); context.RegisterSyntaxNodeAction( f => ReplaceReturnStatementWithExpressionStatementRefactoring.Analyze(f, (YieldStatementSyntax)f.Node), SyntaxKind.YieldReturnStatement); }
private static void AnalyzeReturnStatement(SyntaxNodeAnalysisContext context) { var yieldStatement = (YieldStatementSyntax)context.Node; ReplaceReturnStatementWithExpressionStatementRefactoring.Analyze(context, yieldStatement); }