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