예제 #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();
 }