private GherkinBufferPosition GetLineStartPositionIgnoreWhitespace(int editorLine) { var firstNonWSPosition = GherkinBuffer.GetMatchForLine(nonWhitespaceRe, editorLine); if (firstNonWSPosition != null) { return(firstNonWSPosition); } return(GherkinBuffer.GetLineStartPosition(editorLine)); }
private GherkinBufferPosition GetLineEndPositionIgnoreWhitespace(int editorLine) { var lastNonWSPosition = GherkinBuffer.GetMatchForLine(lastNonWhitespaceRe, editorLine); if (lastNonWSPosition != null && lastNonWSPosition.LinePosition > 0) { return(lastNonWSPosition); } return(GherkinBuffer.GetLineEndPosition(editorLine)); }
public GherkinBufferPosition GetPosition(GherkinBuffer gherkinBuffer) { if (position != null) { Debug.Assert(position.Buffer == gherkinBuffer); return(position); } if (line != null) { return(linePosition == null?gherkinBuffer.GetLineStartPosition(line.Value) : new GherkinBufferPosition(gherkinBuffer, line.Value, linePosition.Value)); } return(null); }
public GherkinBufferPosition GetPosition(GherkinBuffer gherkinBuffer) { if (position != null) { Debug.Assert(position.Buffer == gherkinBuffer); return position; } if (line != null) { return linePosition == null ? gherkinBuffer.GetLineStartPosition(line.Value) : new GherkinBufferPosition(gherkinBuffer, line.Value, linePosition.Value); } return null; }
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)); }
private GherkinBufferSpan[] GetCellSpans(int editorLine, string[] cells) { var cellSeparatorPositions = GherkinBuffer.GetMatchesForLine(cellSeparatorRe, editorLine).ToArray(); var result = new GherkinBufferSpan[cells.Length]; for (int cellIndex = 0; cellIndex < cells.Length; cellIndex++) { if (cellSeparatorPositions.Length - 1 < cellIndex + 1) { break; } result[cellIndex] = new GherkinBufferSpan( cellSeparatorPositions[cellIndex].ShiftByCharacters(1), cellSeparatorPositions[cellIndex + 1]); } return(result); }
public GherkinBufferPosition(GherkinBuffer buffer, int line, int linePosition) { Buffer = buffer; Line = line; LinePosition = linePosition; }
public void Init(GherkinBuffer buffer, bool isPartialScan) { gherkinBuffer = buffer; InitializeFirstBlock(gherkinBuffer.GetLineStartPosition(gherkinBuffer.LineOffset)); VisualStudioTracer.Assert(currentFileBlockBuilder != null, "no current file block builder"); }
public GherkinBufferSpan(GherkinBuffer buffer, int startLine, int startLinePosition, int endLine, int endLinePosition) { StartPosition = new GherkinBufferPosition(buffer, startLine, startLinePosition); EndPosition = new GherkinBufferPosition(buffer, endLine, endLinePosition); }
public GherkinBufferPosition(GherkinBuffer buffer, int line) : this(buffer, line, 0) { }
public GherkinBufferPosition(GherkinBuffer buffer, int line): this(buffer, line, 0) {}
public void Init(GherkinBuffer buffer, bool isPartialScan) { gherkinBuffer = buffer; InitializeFirstBlock(gherkinBuffer.GetLineStartPosition(gherkinBuffer.LineOffset)); Debug.Assert(currentFileBlockBuilder != null); }
public void Init(GherkinBuffer buffer, bool isPartialScan) { this.gherkinBuffer = buffer; }
public ListenerExtender(I18n languageService, IGherkinListener gherkinListener, GherkinBuffer buffer) { this.languageService = languageService; this.gherkinListener = gherkinListener; this.GherkinBuffer = buffer; gherkinListener.Init(buffer, IsIncremental); }
public GherkinScanner(I18n languageService, string gherkinText, int lineOffset) { this.languageService = languageService; this.buffer = new GherkinBuffer(gherkinText, lineOffset); }
public GherkinScanner(GherkinDialect gherkinDialect, string gherkinText, int lineOffset) { this.gherkinDialect = gherkinDialect; this.buffer = new GherkinBuffer(gherkinText, lineOffset); }
public void Init(GherkinBuffer buffer, bool isPartialScan) { //nop; }
public ListenerExtender(GherkinDialect gherkinDialect, IGherkinListener gherkinListener, GherkinBuffer buffer) { this.gherkinDialect = gherkinDialect; this.gherkinListener = gherkinListener; this.GherkinBuffer = buffer; gherkinListener.Init(buffer, IsIncremental); }
private GherkinBufferSpan GetMultilineTextSpan(int editorLine, string text) { int lineCount = GetLineCount(text) + 2; return(GherkinBuffer.GetLineRangeSpan(editorLine, editorLine + lineCount - 1)); }