ReferencesSearch over Modules

Answered

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

3 comments
Comment actions Permalink

Please provide links to full sources of your plugin

0
Comment actions Permalink

Hi Yann,

my plugin code is available at: github.com/timmisset/omt

However, I just found an answer from Dmitry at https://intellij-support.jetbrains.com/hc/en-us/community/posts/206128969-Find-Usages-Scope-Not-Including-Libraries-For-Custom-Language 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.

0
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.

 

0

Please sign in to leave a comment.