コード例 #1
0
 static boolean tryFlip(PsiElement left, PsiElement right) {
   final Language language = left.getLanguage();
   for (Flipper handler : EXTENSION.allForLanguage(language)) {
     if (handler.flip(left, right)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
 private static void swapAtComma(@NotNull PsiElement comma) {
   PsiElement prev = smartAdvance(comma, false);
   PsiElement next = smartAdvance(comma, true);
   if (prev != null && next != null) {
     if (Flipper.tryFlip(prev, next)) {
       return;
     }
     PsiElement copy = prev.copy();
     prev.replace(next);
     next.replace(copy);
   }
 }