String (@NotNull VirtualFile virtualFile, @NotNull Project project) { for (VirtualFileQualifiedNameProvider provider : VirtualFileQualifiedNameProvider.EP_NAME.getExtensionList()) { String qualifiedName = provider.getQualifiedName(project, virtualFile); if (qualifiedName != null) { return qualifiedName; } } VirtualFile baseDirectory = BaseProjectDirectories.getInstance(project).getBaseDirectoryFor(virtualFile); if (baseDirectory != null) { String relativePath = VfsUtilCore.getRelativePath(virtualFile, baseDirectory); if (relativePath != null) { return relativePath; } } RootType rootType = RootType.forFile(virtualFile); if (rootType != null) { VirtualFile scratchRootVirtualFile = VfsUtil.findFileByIoFile(new File(ScratchFileService.getInstance().getRootPath(rootType)), false); if (scratchRootVirtualFile != null) { String scratchRelativePath = VfsUtilCore.getRelativePath(virtualFile, scratchRootVirtualFile); if (scratchRelativePath != null) { return scratchRelativePath; } } } return virtualFile.getPath(); }