boolean (@NotNull Project project, @NotNull ModRenameSymbol rename, @Nullable Editor editor) { VirtualFile file = actualize(rename.file()); if (file == null) return false; PsiFile psiFile = PsiManagerEx.getInstanceEx(project).findFile(file); if (psiFile == null) return false; PsiNameIdentifierOwner element = PsiTreeUtil.getNonStrictParentOfType(psiFile.findElementAt(rename.symbolRange().range().getStartOffset()), PsiNameIdentifierOwner.class); if (element == null) return false; Editor finalEditor = getEditor(project, editor, file); if (finalEditor == null) return false; PsiElement nameIdentifier = element.getNameIdentifier(); if (nameIdentifier == null) return false; if (ApplicationManager.getApplication().isUnitTestMode()) { int offset = nameIdentifier.getTextRange().getEndOffset(); return executeNavigate(project, new ModNavigate(file, offset, offset, offset)); } finalEditor.getCaretModel().moveToOffset(nameIdentifier.getTextOffset()); final RenamePsiElementProcessor processor = RenamePsiElementProcessor.forElement(element); if (!processor.isInplaceRenameSupported()) { fallBackRename(project, rename, element, finalEditor); return true; } processor.substituteElementToRename(element, finalEditor, new Pass<>() { @Override public void pass(PsiElement substitutedElement) { final MemberInplaceRenamer renamer = new MemberInplaceRenamer(element, substitutedElement, finalEditor); final LinkedHashSet<String> nameSuggestions = new LinkedHashSet<>(rename.nameSuggestions()); renamer.performInplaceRefactoring(nameSuggestions); } }); return true; }