void (@NotNull InsertionContext context, @NotNull LookupElement item) { Editor editor = context.getEditor(); char completionChar = context.getCompletionChar(); if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) return; Project project = editor.getProject(); if (project != null) { if (!isCharAtSpace(editor)) { EditorModificationUtilEx.insertStringAtCaret(editor, " "); PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); } else if (shouldOverwriteExistingSpace(editor)) { editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + 1); } if (myTriggerAutoPopup) { AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); } } }