Example #1
0
        private void HandleError(ScanningErrorException scanningErrorException, Exception originalException, ListenerExtender listenerExtender, int errorRertyCount)
        {
            RegisterError(listenerExtender.GherkinListener, scanningErrorException, originalException);

            var position = scanningErrorException.GetPosition(buffer);

//            if (position != null &&
//                position.Line + SKIP_LINES_BEFORE_RETRY <= buffer.LineCount - 1 &&
//                errorRertyCount < MAX_ERROR_RETRY)
            var lastProcessedEditorLine = listenerExtender.LastProcessedEditorLine;

            if (position != null)
            {
                lastProcessedEditorLine = Math.Max(position.Line, lastProcessedEditorLine);
            }

            if (lastProcessedEditorLine + SKIP_LINES_BEFORE_RETRY <= buffer.LineCount - 1 &&
                errorRertyCount < MAX_ERROR_RETRY)
            {
                var restartLineNumber = lastProcessedEditorLine + SKIP_LINES_BEFORE_RETRY;

                DoScan(
                    listenerExtender,
                    restartLineNumber,
                    errorRertyCount + 1);
            }
        }
Example #2
0
        private void RegisterError(IGherkinListener gherkinListener, ScanningErrorException scanningErrorException, Exception originalException)
        {
            var position = scanningErrorException.GetPosition(buffer);

            gherkinListener.Error(
                scanningErrorException.Message,
                position ?? buffer.EndPosition,
                originalException);
        }
Example #3
0
        private void HandleError(ScanningErrorException scanningErrorException, Exception originalException, ListenerExtender listenerExtender, int errorRertyCount)
        {
            RegisterError(listenerExtender.GherkinListener, scanningErrorException, originalException);

            var position = scanningErrorException.GetPosition(buffer);

//            if (position != null &&
//                position.Line + SKIP_LINES_BEFORE_RETRY <= buffer.LineCount - 1 &&
//                errorRertyCount < MAX_ERROR_RETRY)
            var lastProcessedEditorLine = listenerExtender.LastProcessedEditorLine;
            if (position != null)
                lastProcessedEditorLine = Math.Max(position.Line, lastProcessedEditorLine);

            if (lastProcessedEditorLine + SKIP_LINES_BEFORE_RETRY <= buffer.LineCount - 1 &&
                errorRertyCount < MAX_ERROR_RETRY)
            {
                var restartLineNumber = lastProcessedEditorLine + SKIP_LINES_BEFORE_RETRY;

                DoScan(
                    listenerExtender,
                    restartLineNumber,
                    errorRertyCount + 1);
            }
        }
Example #4
0
        private void RegisterError(IGherkinListener gherkinListener, ScanningErrorException scanningErrorException, Exception originalException)
        {
            var position = scanningErrorException.GetPosition(buffer);

            gherkinListener.Error(
                scanningErrorException.Message, 
                position ?? buffer.EndPosition, 
                originalException);
        }