do not show duplicate containing file when navigation element is a file itself
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Tue, 29 Mar 2011 13:27:54 +0000 (17:27 +0400)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Tue, 29 Mar 2011 13:27:54 +0000 (17:27 +0400)
platform/lang-api/src/com/intellij/navigation/PsiGotoRelatedItem.java

index 2b3c9e75c1513db70872ed08a766fc067f4e3385..7980a22c63868b79c64a1799f1f770b80e8327a6 100644 (file)
@@ -50,6 +50,6 @@ public class PsiGotoRelatedItem extends GotoRelatedItem {
 
   @Override
   public PsiFile getContainingFile() {
-    return myElement.getContainingFile();
+    return myElement instanceof PsiFile ? null : myElement.getContainingFile();
   }
 }