void (@NotNull FileViewProvider viewProvider) { if (isViewProviderLocked(viewProvider)) { Throwable cause = viewProvider.getUserData(REFORMAT_ORIGINATOR); @NonNls String message = "Document is locked by write PSI operations. " + "Use PsiDocumentManager.doPostponedOperationsAndUnblockDocument() to commit PSI changes to the document." + "\nUnprocessed elements: " + dumpUnprocessedElements(viewProvider) + (cause == null ? "" : " \nSee cause stacktrace for the reason to lock."); throw cause == null ? new RuntimeException(message): new RuntimeException(message, cause); } }