private static void moveCaretToFinallyBlock(@NotNull ModPsiUpdater updater, @NotNull PsiCodeBlock block) {
    PsiFile file = block.getContainingFile();
    Document document = file.getViewProvider().getDocument();
    Project project = file.getProject();
    updater.moveCaretTo(Objects.requireNonNull(block.getRBrace()));
    PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document);
    TextRange finallyBlockRange = block.getTextRange();
    int newLineOffset = finallyBlockRange.getStartOffset() + 2;
    CodeStyleManager.getInstance(project).adjustLineIndent(document, newLineOffset);
    int lineEndOffset = document.getLineEndOffset(document.getLineNumber(updater.getCaretOffset()) - 1);
    updater.moveCaretTo(lineEndOffset);
  }
private static void moveCaretToFinallyBlock(@NotNull ModPsiUpdater updater, @NotNull PsiCodeBlock block)