void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null || editor.isOneLineMode()) { plainEnter(editor, caret, dataContext); return; } LookupManager.getInstance(project).hideActiveLookup(); TemplateState state = TemplateManagerImpl.getTemplateState(editor); if (state != null) { state.gotoEnd(); } final int caretOffset = editor.getCaretModel().getOffset(); PsiFile psiFile = PsiUtilBase.getPsiFileInEditor(editor, project); if (psiFile == null) { plainEnter(editor, caret, dataContext); return; } if (EnterAfterUnmatchedBraceHandler.isAfterUnmatchedLBrace(editor, caretOffset, psiFile.getFileType())) { EditorActionHandler enterHandler = EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_ENTER); enterHandler.execute(editor, caret, dataContext); return; } final Language language = PsiUtilBase.getLanguageInEditor(editor, project); boolean processed = false; if (language != null) { final List<SmartEnterProcessor> processors = SmartEnterProcessors.INSTANCE.allForLanguage(language); if (!processors.isEmpty()) { for (SmartEnterProcessor processor : processors) { if (processor.process(project, editor, psiFile)) { processed = true; break; } } } } if (!processed) { plainEnter(editor, caret, dataContext); } }