@Nullable public static PsiElement setName(@NotNull DLanguageFuncDeclaration o, @NotNull String newName) { PsiElement e = DElementFactory.createDLanguageFuncDeclarationFromText(o.getProject(), newName); if (e == null) return null; o.replace(e); return o; }
// ------------- Function Definition ------------------ // @NotNull public static String getName(@NotNull DLanguageFuncDeclaration o) { DLanguageFuncDeclarationStub stub = o.getStub(); if (stub != null) return StringUtil.notNullize(stub.getName()); return o.getIdentifier().getText(); }
@Nullable public static PsiElement getNameIdentifier(@NotNull DLanguageFuncDeclaration o) { ASTNode keyNode = o.getNode(); return keyNode != null ? keyNode.getPsi() : null; }
@Override public DLanguageFuncDeclarationStub createStub( @NotNull DLanguageFuncDeclaration psi, StubElement parentStub) { return new DLanguageFuncDeclarationStub(parentStub, this, psi.getName()); }