@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; }
@Nullable public static PsiElement getNameIdentifier(@NotNull DLanguageIdentifier o) { ASTNode keyNode = o.getNode(); return keyNode != null ? keyNode.getPsi() : null; }
// ------------- Identifier ------------------ // @NotNull public static String getName(@NotNull DLanguageIdentifier o) { DLanguageIdentifierStub stub = o.getStub(); if (stub != null) return StringUtil.notNullize(stub.getName()); return o.getText(); }