Find Usages does not work across modules
已回答
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.
请先登录再写评论。
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.
Serge, is there any guide on how to do this "scope adjustment" you are referring to?
Like this:
Unfortunately this doesn't work for PHP modules either. There is also no option to add module dependencies. Am I overlooking something?
Please submit a support ticket for PhpStorm with more details: https://intellij-support.jetbrains.com/hc/requests/new.