コード例 #1
0
        private GherkinBufferPosition GetLineStartPositionIgnoreWhitespace(int editorLine)
        {
            var firstNonWSPosition = GherkinBuffer.GetMatchForLine(nonWhitespaceRe, editorLine);

            if (firstNonWSPosition != null)
            {
                return(firstNonWSPosition);
            }
            return(GherkinBuffer.GetLineStartPosition(editorLine));
        }
コード例 #2
0
        private GherkinBufferPosition GetLineEndPositionIgnoreWhitespace(int editorLine)
        {
            var lastNonWSPosition = GherkinBuffer.GetMatchForLine(lastNonWhitespaceRe, editorLine);

            if (lastNonWSPosition != null && lastNonWSPosition.LinePosition > 0)
            {
                return(lastNonWSPosition);
            }
            return(GherkinBuffer.GetLineEndPosition(editorLine));
        }
コード例 #3
0
 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);
 }
コード例 #4
0
 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;
 }
コード例 #5
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));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public GherkinBufferPosition(GherkinBuffer buffer, int line, int linePosition)
 {
     Buffer       = buffer;
     Line         = line;
     LinePosition = linePosition;
 }
コード例 #8
0
        public void Init(GherkinBuffer buffer, bool isPartialScan)
        {
            gherkinBuffer = buffer;

            InitializeFirstBlock(gherkinBuffer.GetLineStartPosition(gherkinBuffer.LineOffset));
            VisualStudioTracer.Assert(currentFileBlockBuilder != null, "no current file block builder");
        }
コード例 #9
0
 public GherkinBufferSpan(GherkinBuffer buffer, int startLine, int startLinePosition, int endLine, int endLinePosition)
 {
     StartPosition = new GherkinBufferPosition(buffer, startLine, startLinePosition);
     EndPosition   = new GherkinBufferPosition(buffer, endLine, endLinePosition);
 }
コード例 #10
0
 public GherkinBufferPosition(GherkinBuffer buffer, int line) : this(buffer, line, 0)
 {
 }
コード例 #11
0
ファイル: GherkinBuffer.cs プロジェクト: Galad/SpecFlow
 public GherkinBufferPosition(GherkinBuffer buffer, int line): this(buffer, line, 0) 
 {}
コード例 #12
0
ファイル: GherkinBuffer.cs プロジェクト: Galad/SpecFlow
 public GherkinBufferSpan(GherkinBuffer buffer, int startLine, int startLinePosition, int endLine, int endLinePosition)
 {
     StartPosition = new GherkinBufferPosition(buffer, startLine, startLinePosition);
     EndPosition = new GherkinBufferPosition(buffer, endLine, endLinePosition);
 }
コード例 #13
0
        public void Init(GherkinBuffer buffer, bool isPartialScan)
        {
            gherkinBuffer = buffer;

            InitializeFirstBlock(gherkinBuffer.GetLineStartPosition(gherkinBuffer.LineOffset));
            Debug.Assert(currentFileBlockBuilder != null);
        }
コード例 #14
0
ファイル: GherkinBuffer.cs プロジェクト: Galad/SpecFlow
 public GherkinBufferPosition(GherkinBuffer buffer, int line, int linePosition)
 {
     Buffer = buffer;
     Line = line;
     LinePosition = linePosition;
 }
コード例 #15
0
 public void Init(GherkinBuffer buffer, bool isPartialScan)
 {
     this.gherkinBuffer = buffer;
 }
コード例 #16
0
        public ListenerExtender(I18n languageService, IGherkinListener gherkinListener, GherkinBuffer buffer)
        {
            this.languageService = languageService;
            this.gherkinListener = gherkinListener;
            this.GherkinBuffer = buffer;

            gherkinListener.Init(buffer, IsIncremental);
        }
コード例 #17
0
ファイル: GherkinScanner.cs プロジェクト: nandrew/SpecFlow
 public GherkinScanner(I18n languageService, string gherkinText, int lineOffset)
 {
     this.languageService = languageService;
     this.buffer = new GherkinBuffer(gherkinText, lineOffset);
 }
コード例 #18
0
ファイル: GherkinScanner.cs プロジェクト: Galad/SpecFlow
 public GherkinScanner(GherkinDialect gherkinDialect, string gherkinText, int lineOffset)
 {
     this.gherkinDialect = gherkinDialect;
     this.buffer = new GherkinBuffer(gherkinText, lineOffset);
 }
コード例 #19
0
 public void Init(GherkinBuffer buffer, bool isPartialScan)
 {
     //nop;
 }
コード例 #20
0
        public ListenerExtender(GherkinDialect gherkinDialect, IGherkinListener gherkinListener, GherkinBuffer buffer)
        {
            this.gherkinDialect = gherkinDialect;
            this.gherkinListener = gherkinListener;
            this.GherkinBuffer = buffer;

            gherkinListener.Init(buffer, IsIncremental);
        }
コード例 #21
0
        private GherkinBufferSpan GetMultilineTextSpan(int editorLine, string text)
        {
            int lineCount = GetLineCount(text) + 2;

            return(GherkinBuffer.GetLineRangeSpan(editorLine, editorLine + lineCount - 1));
        }
コード例 #22
0
 public GherkinScanner(GherkinDialect gherkinDialect, string gherkinText, int lineOffset)
 {
     this.gherkinDialect = gherkinDialect;
     this.buffer         = new GherkinBuffer(gherkinText, lineOffset);
 }
コード例 #23
0
        public ListenerExtender(GherkinDialect gherkinDialect, IGherkinListener gherkinListener, GherkinBuffer buffer)
        {
            this.gherkinDialect  = gherkinDialect;
            this.gherkinListener = gherkinListener;
            this.GherkinBuffer   = buffer;

            gherkinListener.Init(buffer, IsIncremental);
        }