String (@NotNull PsiElement element) { if (element instanceof PsiPackage pkg) { return pkg.getQualifiedName(); } if (element instanceof PsiJavaModule module) { return module.getName(); } if (element instanceof PsiJavaModuleReferenceElement ref) { PsiJavaModuleReference reference = ref.getReference(); if (reference != null) { PsiJavaModule target = reference.resolve(); if (target != null) { return target.getName(); } } } element = getMember(element); if (element instanceof PsiClass) { return ((PsiClass)element).getQualifiedName(); } else if (element instanceof PsiMember member) { String memberFqn = getMethodOrFieldQualifiedName(member); if (memberFqn == null) return null; if (member instanceof PsiMethod method && MethodSignatureUtil.hasOverloads(method)) { return memberFqn + getParameterString(method); } return memberFqn; } return null; }