fixed completion in multi-language files and added test for PY-1869
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 21 Sep 2010 15:29:43 +0000 (19:29 +0400)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 22 Sep 2010 17:59:44 +0000 (21:59 +0400)
platform/lang-impl/src/com/intellij/psi/MultiplePsiFilesPerDocumentFileViewProvider.java

index 99a1cb8c71eecf0c3ec5163dabbad9757a0bbb13..651d7a81fb1c271aa7589d72a6f9225f45291314 100644 (file)
@@ -164,7 +164,7 @@ public abstract class MultiplePsiFilesPerDocumentFileViewProvider extends Single
       final PsiReference reference = SharedPsiElementImplUtil.findReferenceAt(psiRoot, offset, language);
       if (reference == null) continue;
       final TextRange textRange = reference.getRangeInElement().shiftRight(reference.getElement().getTextRange().getStartOffset());
-      if (minRange.contains(textRange)) {
+      if (minRange.contains(textRange) && !textRange.contains(minRange)) {
         minRange = textRange;
         ret = reference;
       }