Result (char c, @NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { if (!CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET) return Result.CONTINUE; if (c != '{') return Result.CONTINUE; if (!shouldProcess(file)) return Result.CONTINUE; int offset = editor.getCaretModel().getOffset(); if (shouldCloseBrace(editor, offset, c)) { editor.getDocument().insertString(offset, "}"); return Result.STOP; } return Result.CONTINUE; }