String (@NotNull PsiElement element, @NotNull ReferenceKind referenceKind) { if (referenceKind == ReferenceKind.QUALIFIED_NAME) { return element instanceof PsiQualifiedNamedElement ? ((PsiQualifiedNamedElement)element).getQualifiedName() : null; } else { final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element); if (virtualFile == null) { return null; } final Project project = element.getProject(); return FilePatternPackageSet.getRelativePath(virtualFile, ProjectRootManager.getInstance(project).getFileIndex(), true, project.getBaseDir()); } }