Package com.google.collide.dto

Examples of com.google.collide.dto.CodeError


  private void getLinesOfErrorsInViewport(JsonArray<CodeError> errors, JsonArray<Line> lines) {
    LineFinder lineFinder = editor.getDocument().getLineFinder();
    int topLineNumber = editor.getViewport().getTopLineNumber();
    int bottomLineNumber = editor.getViewport().getBottomLineNumber();
    for (int i = 0; i < errors.size(); i++) {
      CodeError error = errors.get(i);
      for (int j = error.getErrorStart().getLineNumber();
           j <= error.getErrorEnd().getLineNumber(); j++) {
        if (j >= topLineNumber && j <= bottomLineNumber) {
          lines.add(lineFinder.findLine(j).line());
        }
      }
    }
View Full Code Here


    codeErrors = JsoArray.create();
  }

  @Override
  public void renderNextChunk(Target target) {
    CodeError nextError = getNextErrorToRender();
    if (nextError == null) {
      // No errors to render. So render the rest of the line with null.
      renderNothingAndProceed(target, currentLineLength - linePosition);
    } else if (nextError.getErrorStart().getLineNumber() < currentLineNumber ||
               nextError.getErrorStart().getColumn() == linePosition) {
      int errorLength;
      if (nextError.getErrorEnd().getLineNumber() > currentLineNumber) {
        errorLength = currentLineLength - linePosition;
      } else {
        // Error ends at current line.
        errorLength = nextError.getErrorEnd().getColumn() + 1 - linePosition;
      }
      renderErrorAndProceed(target, errorLength);
    } else {
      // Wait until we get to the next error.
      renderNothingAndProceed(target, nextError.getErrorStart().getColumn() - linePosition);
    }
  }
View Full Code Here

    linePosition += characterCount;
  }

  private CodeError getNextErrorToRender() {
    while (nextErrorIndex < lineErrors.size()) {
      CodeError nextError = lineErrors.get(nextErrorIndex);
      if (nextError.getErrorEnd().getLineNumber() == currentLineNumber &&
          nextError.getErrorEnd().getColumn() < linePosition) {
        // This may happen if errors overlap.
        nextErrorIndex++;
        continue;
      } else {
        return nextError;
View Full Code Here

  private SortedList<CodeError> getErrorsAtLine(int lineNumber) {
    int oldLineNumber = migrateLineNumber(lineNumber);
    SortedList<CodeError> result = new SortedList<CodeError>(ERROR_COMPARATOR);
    for (int i = 0; i < codeErrors.size(); i++) {
      CodeError error = codeErrors.get(i);
      if (error.getErrorStart().getLineNumber() <= oldLineNumber &&
          error.getErrorEnd().getLineNumber() >= oldLineNumber) {
        result.add(migrateError(error));
      }
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.google.collide.dto.CodeError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.