Concerning PsiReference: Usages doesn't work, if myElement and resolved element have different text

Hi

My plugin finds references from an XMLAttributeValue to a PsiMethod. The
value of XMLAttributeValue is different than the name of PsiMethod. E.g.
,
everything works allright (I mean the plugin behaves allright, the
application stops working ;).

So, what can I do, that the Processor delivered to processQuery(...)
accepts my element?

thank you

2 comments
Comment actions Permalink

You need to extend the referencesSearch extension point and implement a searcher that will find references with non-standard text.

0
Comment actions Permalink

On 16-04-2013 18:36, Dmitry Jemerov wrote:

You need to extend the referencesSearch extension point and implement a searcher that will find references with non-standard text.

>

---
Original message URL: http://devnet.jetbrains.net/message/5484758#5484758

>
Hi

This is what I already did. In my implementation, I have something like:

public void processQuery(@NotNull final
ReferencesSearch.SearchParameters queryParameters, @NotNull final
Processor consumer) {
     final SearchRequestCollector collector = queryParameters.getOptimizer();
...
     collector.searchWord(textToSearch, scope, searchContext, true, method);
}

by debugging I found, that in the class
SingleTargetRequestResultProcessor, the method
processTextOccurrence(...) is called, but consumer.process(ref) always
returns true, if the PsiMethod name, and the XmlAttributeValue name are
different. If they are the same, everything is alright.

What should I do?

0

Please sign in to leave a comment.