IDEA-25204: Can't find usages of filter or servlet
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 4 Mar 2010 09:36:18 +0000 (12:36 +0300)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 4 Mar 2010 09:36:18 +0000 (12:36 +0300)
platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java
platform/lang-impl/src/com/intellij/psi/impl/PomTargetPsiElementImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java

index d8479d40dc0cb9a57f83569547c05b1e9488b6a9..9095d209e5c393b37dbc7c60223bb07542652dd4 100644 (file)
@@ -114,6 +114,10 @@ public class FindUsagesManager implements JDOMExternalizable {
     myAnotherManager = anotherManager;
   }
 
+  /**
+   * @param handler
+   * @deprecated use extension point instead
+   */
   public void registerFindUsagesHandler(FindUsagesHandlerFactory handler) {
     myHandlers.add(0, handler);
   }
index 987cfed9dd861318cf7d609dece467d0a4ec5688..085a802a8cf7613604541b1b6a2d3bebe286ec30 100644 (file)
@@ -123,7 +123,8 @@ public class PomTargetPsiElementImpl extends RenameableFakePsiElement implements
 
   @Override
   public boolean isEquivalentTo(PsiElement another) {
-    return equals(another);
+    return equals(another) ||
+           (another != null && myTarget instanceof PsiTarget && another.isEquivalentTo(((PsiTarget)myTarget).getNavigationElement()));
   }
 
   @Override
index 4a9a36133de60678bf6e8af692f079c0da473f81..4f859ff5ce1e35ab01db1d6f26d84a4525e460cd 100644 (file)
@@ -25,7 +25,6 @@ import com.intellij.util.ArrayUtil;
 import com.intellij.util.ProcessingContext;
 import com.intellij.util.ReflectionCache;
 import com.intellij.util.xml.*;
-import com.intellij.pom.references.PomService;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -104,10 +103,7 @@ public class GenericValueReferenceProvider extends PsiReferenceProvider {
       if (nameValue != null && nameValue.referencable()) {
         DomElement parent = domElement.getParent();
         assert parent != null;
-        final DomTarget target = DomTarget.getTarget(parent);
-        if (target != null) {
-          references = ArrayUtil.append(references, PsiReferenceBase.createSelfReference(psiElement, PomService.convertToPsi(target)), PsiReference.class);
-        }
+        references = ArrayUtil.append(references, PsiReferenceBase.createSelfReference(psiElement, parent.getXmlElement()), PsiReference.class);
       }
     }
     return references;