void (String newName, StartMarkAction markAction) { try { final PsiNamedElement variable = getVariable(); if (variable != null && !newName.equals(myOldName)) { if (isIdentifier(newName, variable.getLanguage())) { final PsiElement substituted = getSubstituted(); if (substituted == null) { return; } Runnable performRunnable = () -> { try (var ignored = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) { if (DumbService.isDumb(myProject)) { DumbService.getInstance(myProject) .showDumbModeNotificationForFunctionality(RefactoringBundle.message("refactoring.not.available.indexing"), DumbModeBlockedFunctionality.MemberInplaceRenamer); return; } final String commandName = RefactoringBundle.message("renaming.0.1.to.2", UsageViewUtil.getType(variable), DescriptiveNameUtil.getDescriptiveName(variable), newName); CommandProcessor.getInstance().executeCommand(myProject, () -> { performRenameInner(substituted, newName); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); }, commandName, null); } }; if (ApplicationManager.getApplication().isUnitTestMode()) { performRunnable.run(); } else { ApplicationManager.getApplication().invokeLater(performRunnable, myProject.getDisposed()); } } } } finally { if (mySuggestedNameInfo != null) mySuggestedNameInfo.nameChosen(newName); try { stopDumbLaterIfPossible(); } finally { FinishMarkAction.finish(myProject, myEditor, markAction); } } }