private GherkinBufferPosition GetLineEndPositionIgnoreWhitespace(int editorLine) { var lastNonWSPosition = GherkinBuffer.GetMatchForLine(lastNonWhitespaceRe, editorLine); if (lastNonWSPosition != null && lastNonWSPosition.LinePosition > 0) { return(lastNonWSPosition); } return(GherkinBuffer.GetLineEndPosition(editorLine)); }
private GherkinBufferPosition GetLineStartPositionIgnoreWhitespace(int editorLine) { var firstNonWSPosition = GherkinBuffer.GetMatchForLine(nonWhitespaceRe, editorLine); if (firstNonWSPosition != null) { return(firstNonWSPosition); } return(GherkinBuffer.GetLineStartPosition(editorLine)); }
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)); }