private @Nullable("null means invalid") ProperTextRange getFixedTextRange(int startOffset) {
    ProperTextRange fixedTextRange;
    TextRange textRange = getHostRange(startOffset);
    if (textRange == null) {
      // todo[cdr] check this fix. prefix/suffix code annotation case
      textRange = findNearestTextRange(startOffset);
      if (textRange == null) return null;
      boolean isBefore = startOffset < textRange.getStartOffset();
      fixedTextRange = new ProperTextRange(isBefore ? textRange.getStartOffset() - 1 : textRange.getEndOffset(),
                                     isBefore ? textRange.getStartOffset() : textRange.getEndOffset() + 1);
    }
    else {
      fixedTextRange = null;
    }
    return fixedTextRange;
  }
private @Nullable("null means invalid") ProperTextRange getFixedTextRange(int startOffset)