Пример #1
0
        public SyntaxNode Remove(SyntaxNode root)
        {
            var fields = new FieldExtractor().Extraxt(root, SyntaxKind.PrivateKeyword);

            // TODO: 1. Fix the issue with touching the namespaces 2.Remove the conditional operator
            return(fields.Count == 0 ? null : root.RemovePrivateTokens(fields));
        }
Пример #2
0
        public SyntaxNode Remove(SyntaxNode root)
        {
            var fields = new FieldExtractor().Extraxt(root, SyntaxKind.PrivateKeyword);

            if (isReportOnlyMode)
            {
                foreach (var field in fields)
                {
                    var lineSpan = field.GetFileLinePosSpan();

                    AddReport(new ChangesReport(root)
                    {
                        LineNumber = lineSpan.StartLinePosition.Line,
                        Column     = lineSpan.StartLinePosition.Character,
                        Message    = "private fields --> private can be removed",
                        Generator  = nameof(FieldTokenRemover)
                    });
                }
            }

            // TODO: 1. Fix the issue with touching the namespaces 2.Remove the conditional operator
            return(fields.Count == 0 ? null : root.RemovePrivateTokens(fields));
        }