private static boolean inCommentOrLiteral(CompletionParameters parameters) {
    HighlighterIterator iterator = parameters.getEditor().getHighlighter().createIterator(parameters.getOffset());
    if (iterator.atEnd()) return false;

    IElementType elementType = iterator.getTokenType();
    if (elementType == CustomHighlighterTokenType.WHITESPACE) {
      iterator.retreat();
      elementType = iterator.getTokenType();
    }
    return elementType == CustomHighlighterTokenType.LINE_COMMENT ||
           elementType == CustomHighlighterTokenType.MULTI_LINE_COMMENT ||
           elementType == CustomHighlighterTokenType.STRING ||
           elementType == CustomHighlighterTokenType.SINGLE_QUOTED_STRING;
  }
private static boolean inCommentOrLiteral(CompletionParameters parameters)