Find Usages does not work across modules

Answered

I've set up a multi-module project and all the modules were imported using gradle files. Find Usages returns empty result when I search for a class (say in module X) used by another module (say module Y) in the same project. FYI, the module Y has maven dependency on the jar built with module X.

Find Usages however returns results if I add module dependency (that Y depends on X). But this module dependency gets overwritten during automatic/manual gradle refresh. Moreover, adding the module dependencies makes the IDE less responsive.

IntelliJ Version: 15.0.3 (Build #143.1821). On Mac.

5 comments
Comment actions Permalink

If the dependencies are resolved via the modules, not via the jars, find usages will work fine. When jar dependencies are used, you need to adjust the scope of the find usages to Project and Libraries, otherwise the libraries are not searched by default.

0
Comment actions Permalink

Serge, is there any guide on how to do this "scope adjustment" you are referring to?

0
Comment actions Permalink

Unfortunately this doesn't work for PHP modules either. There is also no option to add module dependencies. Am I overlooking something?

0
Comment actions Permalink

Please submit a support ticket for PhpStorm with more details: https://intellij-support.jetbrains.com/hc/requests/new.

1

Please sign in to leave a comment.