http://ea.jetbrains.com/browser/ea_problems/17270 : java class references suppressed...
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 11 Mar 2010 07:20:55 +0000 (10:20 +0300)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 11 Mar 2010 07:20:55 +0000 (10:20 +0300)
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassListReferenceProvider.java

index 601012827e5cd32f884cd9c71eebf80a0dd2ec9c..f73bb3e6b03bc8bd8e828238b5af04cbf993588c 100644 (file)
@@ -23,7 +23,6 @@ import com.intellij.psi.PsiPackage;
 import com.intellij.psi.PsiReference;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.templateLanguages.OuterLanguageElement;
-import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.xml.XmlTag;
 import org.jetbrains.annotations.NotNull;
 
@@ -53,8 +52,13 @@ public class JavaClassListReferenceProvider extends JavaClassReferenceProvider {
       return PsiReference.EMPTY_ARRAY;
     }
 
-    if (position != null && PsiTreeUtil.getChildOfType(position, OuterLanguageElement.class) != null) {
-      return PsiReference.EMPTY_ARRAY;
+    if (position != null) {
+      int offset = position.getTextRange().getStartOffset() + offsetInPosition;
+      for(PsiElement child = position.getFirstChild(); child != null; child = child.getNextSibling()){
+        if (child instanceof OuterLanguageElement && child.getTextRange().contains(offset)) {
+          return PsiReference.EMPTY_ARRAY;
+        }
+      }
     }
 
     NotNullLazyValue<Set<String>> topLevelPackages = new NotNullLazyValue<Set<String>>() {