From 70c505b519a5463bcf31ee6577fa99a074514d01 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 25 Dec 2009 20:14:42 +0300 Subject: [PATCH] correct filtering of goto file model when language substitutors are used (PY-269) --- .../intellij/ide/util/gotoByName/GotoFileModel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java index bd0a6194bd77..b0f23436c123 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java @@ -70,7 +70,15 @@ public class GotoFileModel extends ContributorsBasedGotoByModel{ if (item instanceof PsiFile) { final PsiFile file = (PsiFile)item; final Set types = getFileTypes(); - return types == null || types.contains(file.getFileType()); + // if language substitutors are used, PsiFile.getFileType() can be different from + // PsiFile.getVirtualFile().getFileType() + if (types != null) { + if (types.contains(file.getFileType())) return true; + VirtualFile vFile = file.getVirtualFile(); + if (vFile != null && types.contains(vFile.getFileType())) return true; + return false; + } + return true; } else { return super.acceptItem(item);