KronicDeth / intellij-elixir

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

Jump to deps modules with ctrl+click #1398

Closed JerryBels closed 5 years ago

JerryBels commented 5 years ago

Hello,

Currently when you want to see deps code to check how a given library handles things, you got to search for it manually.

I want to index deps code, such as when I ctrl+click a module / function from a dep I get taken there directly, like my own code.

KronicDeth commented 5 years ago

That works and has worked for a long time. Before v10.0.0, the deps directory wasn't marked as Excluded and all deps were indexed as part of the project. Afer v10.0.0`deps were added as External Libraries.

Here's how it looks in an umbrella project for v10.2.0.

I can Cmd+Click (macOS version of Ctrl+Click) on from that is imported from Ecto.Query and it shows the ability to jump to the near import or the actual definition in the dep:

screen shot 2019-02-21 at 7 39 19 am

If I select the definition it jumps there.

screen shot 2019-02-21 at 7 39 26 am

The deps director because it represents external libraries is marked as ignored

screen shot 2019-02-21 at 7 39 44 am

But, they are still indexed because they're registered (automatically by Virtual Filesystem water) as External Libraries.

screen shot 2019-02-21 at 7 40 23 am

Those libraries are then attached as Dependencies to the Modules. This is done with another watcher that interprets the mix.exs deps function.

screen shot 2019-02-21 at 7 40 38 am

These screenshots are from IntelliJ IDEA Ultimate, but it would look the same in IntellIJ IDEA Community Edition. For single-language IDEs the view is different because they hide the Module system and only allow 1 Module per Project, so umbrellas end up as multi-project instead.

Which IDE are you using? If you want to show me what you're seeing we can setup a Zoom video chat. Just email at the address on my GitHub profile.

JerryBels commented 5 years ago

Hey man :)

Actually it does work in some projects - the older ones, I can get to whatever function I want in deps. Which makes me guess it might be related to this issue : https://github.com/KronicDeth/intellij-elixir/issues/1378

On older projects, I have the SDK defined correctly. Everything works as expected (and as I was remembering it should).

On new projects, it doesn't work at all until I try the hack offered by Mike on the linked topic, and then it does work partially - native Elixir features opens, but deps won't. Which seems related to them not getting the SDK correctly defined.

I'm on PHPStorm ATM. Would you recommend trying out IDEA Community Edition ?

KronicDeth commented 5 years ago

I'm on PHPStorm ATM. Would you recommend trying out IDEA Community Edition ?

Yes, if you can use IntelliJ it will be a better experience. IntelliJ supports multi-modules and external dependency management while support in the single-language IDEs is me backporting features, so it is more likely to be buggy as #1378 shows.

JerryBels commented 5 years ago

Okay, looks like community edition is perfect for Elixir... Does the Ultimate Edition gives you more for Elixir programming specifically ?

Anyways, closing this now as the real bug is #1378