void (InsertionContext context, LookupElement item) { if (!context.getOffsetMap().containsOffset(InsertionContext.TAIL_OFFSET)) { @NonNls String message = "tailOffset<0 after inserting " + item + " of " + item.getClass(); if (context instanceof WatchingInsertionContext) { message += "; invalidated at: " + ((WatchingInsertionContext)context).invalidateTrace + "\n--------"; } LOG.info(message); } else if (!CompletionAssertions.isEditorValid(context.getEditor())) { LOG.info("Injected editor invalidated " + context.getEditor()); } else { context.getEditor().getCaretModel().moveToOffset(context.getTailOffset()); } if (context.getCompletionChar() == Lookup.COMPLETE_STATEMENT_SELECT_CHAR) { Language language = PsiUtilBase.getLanguageInEditor(context.getEditor(), context.getFile().getProject()); if (language != null) { for (SmartEnterProcessor processor : SmartEnterProcessors.INSTANCE.allForLanguage(language)) { if (processor.processAfterCompletion(context.getEditor(), context.getFile())) break; } } } else { DataContext dataContext = DataManager.getInstance().getDataContext(context.getEditor().getContentComponent()); EditorActionManager.getInstance(); TypedAction.getInstance().getHandler().execute(context.getEditor(), context.getCompletionChar(), dataContext); } }