@NotNull
  @Override
  public Result beforeCharTyped(final char c, @NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file, @NotNull final FileType fileType) {
    int offsetBefore = editor.getCaretModel().getOffset();

    //important to calculate before inserting charTyped
    myJavaLTTyped = '<' == c &&
                    file instanceof GroovyFile &&
                    CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET &&
                    isAfterClassLikeIdentifier(offsetBefore, editor);

    if ('>' == c) {
      if (file instanceof GroovyFile && CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET) {
        if (TypedHandlerUtil.handleGenericGT(editor, GroovyTokenTypes.mLT, GroovyTokenTypes.mGT, INVALID_INSIDE_REFERENCE)) return Result.STOP;
      }
    }

    if (c == '@' && file instanceof GroovyFile) {
      autoPopupMemberLookup(project, editor, file12 -> {
        int offset = editor.getCaretModel().getOffset();

        PsiElement lastElement = file12.findElementAt(offset - 1);
        if (lastElement == null) return false;

        final PsiElement prevSibling = PsiTreeUtil.prevVisibleLeaf(lastElement);
        return prevSibling != null && ".".equals(prevSibling.getText());
      });
    }

    if (c == '&' && file instanceof GroovyFile) {
      autoPopupMemberLookup(project, editor, file1 -> {
        int offset = editor.getCaretModel().getOffset();

        PsiElement lastElement = file1.findElementAt(offset - 1);
        return lastElement != null && ".&".equals(lastElement.getText());
      });
    }

    if (c == '.' && file instanceof GroovyFile) {
      autoPopupMemberLookup(project, editor, null);
    }

    return Result.CONTINUE;
  }
@NotNull
  @Override
  public Result beforeCharTyped(final char c, @NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file, @NotNull final FileType fileType)