PsiElement (@NotNull final String newElementName) { final String s = getRangeText(); int pos = s.lastIndexOf("/"); if (pos < 0) { updateRangeText(newElementName); } else { updateRangeText(s.substring(0, pos+1) + newElementName); } return myFile; }