ReferencesSearch over Modules


I have implemented a FindUsagesHandlerFactory that is used to find usages from a specific class in 2 different languages (both languages are part of the plugin). Everything works fine except it won't find references that are located in a different Module.

I override the 'createSearchParameters' and use:

new ReferencesSearch.SearchParameters(GlobalSearchScope.allScope(project), false, null);

I have tried true and false for the ignoreAccessScope (second argument)
Also I have tried the projectScope, allScope and everythingScope.

I can also confirm with debugging that when I move the references that should be found to the same module as the class they are hit with via isReferenceTo() method, this method is not called when they are in different modules.

Any idea if this is a simple setting I need to change or do I need to make the ReferencesSearch index aware of the other module somehow?

Kr, Tim

Comment actions Permalink

Please provide links to full sources of your plugin

Comment actions Permalink

Hi Yann,

my plugin code is available at:

However, I just found an answer from Dmitry at which also worked for my case. The trick was setting the useScope of the element I was trying to find the usage for to allScope.

Comment actions Permalink

Thanks for the update. Yes, that's one of the many places influencing it. You probably don't need custom ReferencesSearch magic anymore now.



Please sign in to leave a comment.