void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { if (PsiImplUtil.isWhiteSpaceOrNls(element)) { element = PsiTreeUtil.prevLeaf(element); } LOG.assertTrue(GeeseUtil.isClosureRBrace(element) && GeeseUtil.isClosureContainLF(element)); PsiFile file = element.getContainingFile(); Document document = file.getViewProvider().getDocument(); TextRange textRange = findRange(element); int startOffset = textRange.getStartOffset(); int endOffset = textRange.getEndOffset(); RangeMarker rangeMarker = document.createRangeMarker(textRange); String text = document.getText(); for (int i = endOffset - 1; i >= startOffset; i--) { if (text.charAt(i) == '\n') document.deleteString(i, i + 1); } CodeStyleManager.getInstance(context.project()).reformatText(file, rangeMarker.getStartOffset(), rangeMarker.getEndOffset()); }