void (@NotNull final Project project, @NotNull final Editor editor) { AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, file -> { int offset = editor.getCaretModel().getOffset(); PsiElement lastElement = file.findElementAt(offset - 1); return lastElement != null && StringUtil.endsWithChar(lastElement.getText(), '@'); }); }