Пример #1
0
        private GherkinBufferPosition GetLineEndPositionIgnoreWhitespace(int editorLine)
        {
            var lastNonWSPosition = GherkinBuffer.GetMatchForLine(lastNonWhitespaceRe, editorLine);

            if (lastNonWSPosition != null && lastNonWSPosition.LinePosition > 0)
            {
                return(lastNonWSPosition);
            }
            return(GherkinBuffer.GetLineEndPosition(editorLine));
        }
Пример #2
0
        private GherkinBufferPosition GetLineStartPositionIgnoreWhitespace(int editorLine)
        {
            var firstNonWSPosition = GherkinBuffer.GetMatchForLine(nonWhitespaceRe, editorLine);

            if (firstNonWSPosition != null)
            {
                return(firstNonWSPosition);
            }
            return(GherkinBuffer.GetLineStartPosition(editorLine));
        }
Пример #3
0
        private GherkinBufferSpan GetDescriptionSpan(int titleEditorLine, string description)
        {
            if (string.IsNullOrEmpty(description) || whitespaceOnlyRe.Match(description).Success)
            {
                return(null);
            }

            int descriptionStartLine = titleEditorLine + 1;

            while (GherkinBuffer.GetMatchForLine(whitespaceOnlyRe, descriptionStartLine) != null)
            {
                descriptionStartLine++;
            }

            int lineCount = GetLineCount(description);

            return(GherkinBuffer.GetLineRangeSpan(descriptionStartLine, descriptionStartLine + lineCount - 1));
        }