public static String getContextName(@NotNull PsiElement element,
                                      boolean qualified,
                                      boolean ignorePsiClassOwner) {
    PsiElement parent = PsiTreeUtil.getStubOrPsiParentOfType(element, PsiMember.class);
    if (parent == null) parent = element.getContainingFile();
    while(true){
      if (parent == null) return null;
      String name = getNameForElement(parent, qualified, ignorePsiClassOwner);
      if (name != null) return name;
      if (parent instanceof PsiFile) return null;
      parent = PsiTreeUtil.getStubOrPsiParent(parent);
    }
  }
public static String getContextName(@NotNull PsiElement element,
                                      boolean qualified,
                                      boolean ignorePsiClassOwner)