@Nullable public static PsiElement setName(@NotNull DLanguageIdentifier o, @NotNull String newName) { PsiElement e = DElementFactory.createDLanguageIdentifierFromText(o.getProject(), newName); if (e == null) return null; o.replace(e); return o; }