Пример #1
0
        public static SyntaxTree ToggleSingleLineComment(this SyntaxTree syntaxTree, TextSpan textSpan)
        {
            if (syntaxTree == null)
            {
                throw new ArgumentNullException(nameof(syntaxTree));
            }

            var comments = syntaxTree.GetConsecutiveSingleLineComments(textSpan);

            return(comments.IsDefaultOrEmpty
                    ? syntaxTree.CommentSingleLineComment(textSpan)
                    : syntaxTree.UncommentSingleLineComment(comments));
        }