Exemple #1
0
        private static SyntaxTree UncommentMultiLineComment(this SyntaxTree syntaxTree, SyntaxTrivia comment)
        {
            var changes = new List <TextChange>(2);

            changes.Add(TextChange.ForDeletion(new TextSpan(comment.Span.Start, 2)));

            if (comment.IsTerminated())
            {
                changes.Add(TextChange.ForDeletion(new TextSpan(comment.Span.End - 2, 2)));
            }

            return(syntaxTree.WithChanges(changes));
        }
Exemple #2
0
        private static SyntaxTree UncommentSingleLineComment(this SyntaxTree syntaxTree, ImmutableArray <SyntaxTrivia> textSpan)
        {
            var changes = textSpan.Select(t => TextChange.ForDeletion(new TextSpan(t.Span.Start, 2)));

            return(syntaxTree.WithChanges(changes));
        }