void (@NotNull PsiElement element, @NotNull String newName, @NotNull Map<PsiElement, String> allRenames) { final PsiFile file = (PsiFile)element; if (file instanceof PyiFile) { final PsiElement originalElement = PyiUtil.getOriginalElement((PyiFile)file); if (originalElement != null) { allRenames.put(originalElement, newName.substring(0, newName.length() - 1)); } } else if (file instanceof PyFile) { final PsiElement stubElement = PyiUtil.getPythonStub((PyFile)file); if (stubElement != null) { allRenames.put(stubElement, newName + "i"); } } super.prepareRenaming(element, newName, allRenames); }