예제 #1
0
        public SyntaxNode ConvertMembersToExpressionBodiedHelper(SyntaxNode initialSourceNode, ICleanupOption options)
        {
            var rewriter           = new Rewriter(IsReportOnlyMode, options);
            var modifiedSourceNode = rewriter.Visit(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(rewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSourceNode);
        }
        SyntaxNode RemoveAttributeKeyworkHelper(SyntaxNode initialSourceNode, SemanticModel semanticModel)
        {
            var syntaxRewriter     = new Rewriter(semanticModel, IsReportOnlyMode, Options);
            var modifiedSyntaxNode = syntaxRewriter.Visit(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(syntaxRewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSyntaxNode);
        }
        public SyntaxNode SimplifyClassFieldDeclarationsHelper(SyntaxNode initialSourceNode, bool isReportOnlyMode, ICleanupOption options)
        {
            var rewriter           = new Rewriter(isReportOnlyMode, options);
            var modifiedSourceNode = rewriter.Visit(initialSourceNode);

            if (isReportOnlyMode)
            {
                CollectMessages(rewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSourceNode);
        }
예제 #4
0
        public override async Task <SyntaxNode> CleanUpAsync(SyntaxNode initialSourceNode)
        {
            var rewriter           = new Rewriter(ProjectItemDetails, IsReportOnlyMode, Options);
            var modifiedSourceNode = rewriter.Visit(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(rewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSourceNode);
        }
예제 #5
0
        public override async Task <SyntaxNode> CleanUpAsync(SyntaxNode initialSourceNode)
        {
            var rewriter           = new Rewriter(IsReportOnlyMode, Options);
            var modifiedSourceNode = rewriter.Visit(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(rewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSourceNode);
            // return SimplyAsyncCallsHelper2(initialSourceNode);
        }
예제 #6
0
        public override async Task <SyntaxNode> CleanUpAsync(SyntaxNode initialSourceNode)
        {
            var syntaxRewriter = new Rewriter(ProjectItemDetails.SemanticModel, IsReportOnlyMode
                                              , Options);

            var modifiedSourceNode = syntaxRewriter.ConvertFullNameTypesToBuiltInTypesHelper(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(syntaxRewriter.GetReport());
                return(initialSourceNode);
            }

            return(modifiedSourceNode);
        }
        public override async Task <SyntaxNode> CleanUpAsync(SyntaxNode initialSourceNode)
        {
            var syntaxRewriter     = new Rewriter(initialSourceNode, IsReportOnlyMode, Options);
            var modifiedSourceNode = syntaxRewriter.Visit(initialSourceNode);

            if (IsReportOnlyMode)
            {
                CollectMessages(syntaxRewriter.GetReport());
                return(initialSourceNode);
            }

            if (modifiedSourceNode != initialSourceNode && TidyCSharpPackage.Instance != null)
            {
                initialSourceNode = Formatter.Format(modifiedSourceNode, TidyCSharpPackage.Instance.CleanupWorkingSolution.Workspace);
            }

            return(initialSourceNode);
        }