From 570dcc898dd7014974f159727c45e3679bdd1a59 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 6 Sep 2012 15:41:11 +0200 Subject: [PATCH] IDEA-90428 CTRL+ SHIFT + N dialog should show paths relative to content url(not to .idea folder locations) --- .../intellij/ide/util/gotoByName/GotoFileCellRenderer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java index 35995650f86d..463eba6a72c1 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java @@ -24,7 +24,9 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.util.Iconable; +import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiFile; @@ -80,6 +82,11 @@ public class GotoFileCellRenderer extends PsiElementListCellRenderer { if (project == null) { return url; } + VirtualFile root = ProjectFileIndex.SERVICE.getInstance(project).getContentRootForFile(virtualFile); + if (root != null) { + return VfsUtilCore.getRelativePath(virtualFile, root, File.separatorChar); + } + final VirtualFile baseDir = project.getBaseDir(); if (baseDir != null) { //noinspection ConstantConditions