void (String newName) { PsiElement element = TargetElementUtil.findTargetElement(getEditor(), TargetElementUtil .ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); element = RenamePsiElementProcessor.forElement(element).substituteElementToRename(element, getEditor()); assertNotNull(element); RenameProcessor processor = new RenameProcessor(getProject(), element, newName, false, false); for (AutomaticRenamerFactory factory : AutomaticRenamerFactory.EP_NAME.getExtensionList()) { processor.addRenamerFactory(factory); } processor.run(); }