Ejemplo n.º 1
0
        private static bool IsFollowedByComment(SnapshotPoint point, ISplitCommentService splitCommentService)
        {
            var line = point.GetContainingLine();

            // skip past following whitespace.
            while (point < line.End && char.IsWhiteSpace(point.GetChar()))
            {
                point += 1;
            }

            return(MatchesCommentStart(splitCommentService.CommentStart, point));
        }
Ejemplo n.º 2
0
        private static bool LineProbablyContainsComment(ISplitCommentService service, SnapshotPoint position)
        {
            var commentStart = service.CommentStart;
            var line         = position.GetContainingLine();

            for (var p = line.Start.Position; p < position; p++)
            {
                if (MatchesCommentStart(commentStart, line, p))
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        private static bool LineProbablyContainsComment(ISplitCommentService service, ITextSnapshotLine line, int caretPosition)
        {
            var commentStart = service.CommentStart;

            var end = Math.Max(caretPosition, line.Length);

            for (var i = 0; i < end; i++)
            {
                if (MatchesCommentStart(line, commentStart, i))
                {
                    return(true);
                }
            }

            return(false);
        }