KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.8k stars 152 forks source link

Does not find function usage across apps in an umbrella project #3575

Closed XiXiaPdx closed 2 months ago

XiXiaPdx commented 2 months ago

Describe the bug Find usage does not appear to find usages across umbrella apps.

I have an umbrella app with 2 apps, called_here and defined_here. There is one module in each app.

Screenshot 2024-04-23 at 10 33 27 AM

In defined_here, there is a public function hello()

Screenshot 2024-04-23 at 10 41 51 AM

In called_here, I'm calling DefinedHere.hello().

Screenshot 2024-04-23 at 10 42 04 AM

Using Find Usage for hello() in defined_here , I see one usage in the test directory. I would have expected to also see the usage in called_here.

Screenshot 2024-04-23 at 10 38 51 AM

To Reproduce Steps to reproduce the behavior:

Use mix to create a new umbrella app and create two apps in it.

Expected behavior

I would have expected Find Usage to show the usage of hello() in called_here module.

I appreciate all the time and work you have put into this plugin!! Because of this, I was able to keep using Intellij when I started Elixir development. I'm relatively new to it so I might be missing some key setup for Find Usage to work properly.

KronicDeth commented 2 months ago

Does the mix.exs in the called_here project declare the defined here as a dependency? The Find Usage respects declared dependencies and won't search sibling projects that aren't dependencies.

XiXiaPdx commented 2 months ago

Oh I see, that totally fixed it for my repro example! I wonder why my work project doesn't work 🤔

I double checked my work project and the dependencies between the two apps are declared. However, the Find Usage doesn't pick it up.

In my repro, I see that purple elixir liquid icon on the called_here and defined_here directories. But my work project doesn't have that icon.

Screenshot 2024-04-23 at 3 24 37 PM

Looking at the repro app Project Structure UI, I think I'm making some surface connections.

Screenshot 2024-04-23 at 3 40 41 PM

My work app has 15+ umbrella apps and only one module is visible when I select "module". The one module is lacking the purple elixir icon as well...I'm guessing my project had a funky import.

I'm going to try to see if I can figure this out. Thank you again