KronicDeth / intellij-elixir

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

Project .iml not updating #1830

Open Snackin opened 4 years ago

Snackin commented 4 years ago

Describe the bug If an Elixir Project is created with an older version of an Elixir SDK and a Newer one is chosen through the Project Structure -> Platform Settings -> SDKs menu, the SDK used isn't updated when the project is run.

To Reproduce Steps to reproduce the behavior:

  1. Create a project and Add an older Elixir SDK to the project.
  2. Create a Run Configuration (I used IEX and Mix both and got similar results)
  3. Click on Project Structure...
  4. Scroll down to platform Settings -> SDKs
  5. Choose the Newer Elixir SDK Home Path
  6. Build/Run/Debug Your Configuration

Expected behavior run Configuration would use the Newer Erlang library when configured

Screenshots

Desktop:

Erlang:

Elixir:

Plugin:

Additional context I was trying to get debugging to work and noticed in the Debugging Console, the follwoing (partial for brevity) line was being issued:

C:\erl-10.1\bin\erl.exe -pa C:/erl-10.1/lib/asn1-5.0.13/ebin -pa .......

However, when I checked the project structure, the UI showed Elixir 1.10.4 with Erlang for Elixir 23 was configured for the project. Just on a lark, I checked the .iml file and saw the configuration still had the older Elixir 1.9.4 in it. I manually updated the facet tag to 1.10.4 and everything worked.

I don't know if this is a plugin issue or not, I guess I just expected something to update the *.iml so when I switched Elixir Libraries, it would debug in the one I chose and not the old one.

Thanks!

drl123 commented 3 years ago

FYI - I have similar issues on both macOS and Ubuntu. What happens is the Elixir SDK gets set when you first open the project and set it.

If you change the SDK to a different one, exit and come back in, you'll see you are still on the original SDK chosen. If you close the IDE and manually edit the .iml file to the new SDK, then reopen the IDE, you'll now be set to that new version and all of the run configurations, debug and terminal will be using that SDK.

FWIW - I'm using Rubymine 2020.3.1 and I've also installed Elixir and Erlang using ASDF...not sure if that matters though.

KronicDeth commented 3 years ago

@drl123 being on Rubymine does matter - on Small IDEs (those that are language-specific, like Rubymine), Elixir support is done by treating Elixir as a Framework, not a language, since Small IDEs require their specific language to always be the project language.

In either case, I think I recall seeing compiler deprecation warnings about the project storage API changing and it could be that they aren't breaking in an exception at runtime, but just not writing to disk anymore 😞

drl123 commented 3 years ago

Thanks @KronicDeth. I knew the small IDE's handle it differently. It's just odd that it created the IML correctly when the project was initially created, just wouldn't update it. The work around is to either just edit the IML, or exit the project, wipe the file and reopen it.

PS...I'd be happy to test any fixes for you...just reach out and let me know.

BTW...Thanks for all you do on this project. It is awesome work and much appreciated!