How to make Find Usages work for classes resolved by convertor in xml file?

I have created IntelliJ IDEA DOM model for my xml file and annotated one of attribute getter with converter. Converter resolves attribute value to PsiClass and implements CustomReferenceConverter.
Now I can navigate from attribute to class by Go to Declaration action.
But if I try to find usages of resolved class then Idea says No usages found in Project files.
How to make Find Usages of class return usages in xml file?

4 comments
Comment actions Permalink

I have created IntelliJ IDEA DOM model for my xml file and annotated one of attribute getter with converter. Converter resolves attribute value to PsiClass and implements CustomReferenceConverter.
Now I can navigate from attribute to class by Go to Declaration action.
But if I try to find usages of resolved class then Idea says No usages found in Project files.
How to make Find Usages of class return usages in xml file?

Do you have the checkbox "search in non-java files" on?

0
Comment actions Permalink

If this checkbox set on then search returns text occurrences of class name instead of xml fragment that resolved to class.
Example:
]]>
Here AIM_DownloadReport resolved to class job.DownloadReport
Ctrl-B moves from "AIM_DownloadReport" to class job.DownloadReport

But if I search usages of class job.DownloadReport then search returns nothing.
If checkbox "search in non-java files" set on then search returns text occurrences of "job.DownloadReport" but not my task.

0
Comment actions Permalink

If this checkbox set on then search returns text occurrences of class name instead of xml fragment that resolved to class.
Example:
<task name="AIM_DownloadReport"/>
Here AIM_DownloadReport resolved to class job.DownloadReport
Ctrl-B moves from "AIM_DownloadReport" to class job.DownloadReport

But if I search usages of class job.DownloadReport then search returns nothing.
If checkbox "search in non-java files" set on then search returns text occurrences of "job.DownloadReport" but not my task.


Ahaa. When you have reference whose text isn't equal to the target name,
you should implement your own referencesSearch extension searcher, and
find such usages inside it.

0
Comment actions Permalink

Thank you. Extension for referencesSearch solves problem.

0

Please sign in to leave a comment.