String (@Nullable final PsiElement element, @Nullable Editor editor) { String result = getQualifiedNameFromProviders(element); if (result != null) return result; if (editor != null) { //IDEA-70346 PsiReference reference = TargetElementUtilBase.findReference(editor, editor.getCaretModel().getOffset()); if (reference != null) { result = getQualifiedNameFromProviders(reference.resolve()); if (result != null) return result; } } if (element instanceof PsiFile) { return FileUtil.toSystemIndependentName(getFileFqn((PsiFile)element)); } if (element instanceof PsiDirectory) { return FileUtil.toSystemIndependentName(getVirtualFileFqn(((PsiDirectory)element).getVirtualFile(), element.getProject())); } return null; }