String (@Nullable PsiJavaCodeReferenceElement ref) { if (ref != null) { final PsiReference reference = ref.getReference(); if (reference != null && reference.resolve() instanceof PsiClass cls) { return cls.getQualifiedName(); } } return null; }