private static void AnalyzeReturnStatement(SyntaxNodeAnalysisContext context)
        {
            MergeLocalDeclarationWithReturnStatementRefactoring.Analyze(context);

            var returnStatement = (ReturnStatementSyntax)context.Node;

            ReplaceReturnStatementWithExpressionStatementRefactoring.Analyze(context, returnStatement);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        private static void AnalyzeReturnStatement(SyntaxNodeAnalysisContext context)
        {
            var yieldStatement = (YieldStatementSyntax)context.Node;

            ReplaceReturnStatementWithExpressionStatementRefactoring.Analyze(context, yieldStatement);
        }