Hi!
I'm using Elixir installed with asdf version manager and I believe this is the only reason why your plug-in can't find Elixir SDK.
asdf is using the next directories structure:
/home/
/home/
Thanks a lot for the great product!
So what is your issue about? Are you saying plugin should support ASDF-managed elixir installations?
@develop7, thanks for the question.
There is an ask in the plugin initializer to send environment info if this plugin can't find Elixir paths by itself. So I did.
As there is no syntax highlighting at the moment (or I haven't found the way to enable it after a brief look) I went back to the sublime with ElixirSublime and can't make a PR to add asdf support.
When selecting the directory, intellij cannot find elixir and just shows the following messages:
Probably SDK installed in '/home/user/.asdf/installs/elixir/1.3.2' is corrupt
Unknown Elixir version at /home/user/.asdf/installs/elixir/1.3.2
Also, it would be great if the plugin would read .tool-versions (file created by asdf) and setup elixir automatically.
A workaround that works for me:
cd ~/bin
ln -s ~/.asdf/shims/elixir
ln -s ~/.asdf/shims/erl
ln -s ~/.asdf/shims/mix
ln -s ~/.asdf/shims/iex
After this I remove and add again the asdf elixir sdk and it is found correctly.
Update:
As per project the plugin should select the Elixir SDK folder this issue does'nt happen right now,
but i'm trying to executing the debug and he gets the system Erlang witch is different from asdf,
so I needed to set again ln -s ~/.asdf/shims/erl to work properly.
As a point of interest, I was able to get the SDK set up in OS/X with asdf installed via brew install asdf by adding the directories /usr/local/Cellar/asdf/0.4.0/installs/elixir/1.5.3 and /usr/local/Cellar/asdf/0.4.0/installs/erlang/20.1 to the global SDKs. I'm still running into the hex issue described in #823 though.
My IntelliJ plugin-fu is probably not good enough to come up with a PR for this, but I can at least describe the steps needed to find an asdf Elixir install:
asdf global elixir settings:% cat ~/.tool-versions
erlang 20.1
elixir 1.5.3
asdf to be installed. Find the install roots via:% asdf where erlang 20.1
/usr/local/opt/asdf/installs/erlang/20.1
% asdf where elixir 1.5.3
/usr/local/opt/asdf/installs/elixir/1.5.3
% $(asdf where elixir 1.5.3)/bin/mix hex
Hex v0.17.1
Hex is a package manager for the Erlang ecosystem.
[...]
asdf where as $ASDF_INSTALL_PATH:https://github.com/asdf-vm/asdf-elixir/blob/master/bin/exec-env
@timgilbert How does one add those paths to "the global SDKs"? Is it https://www.jetbrains.com/help/idea/working-with-sdks.html#manage_sdks?
@wizonesolutions: yeah, I set them in the global SDK settings. It's not super obvious where they live but you can get to them like this:
+ sign and select "Erlang SDK for Elixir SDK"/usr/local/opt/asdf, click into installs/erlang/20.2 and hit Open.+ again to add the Elixir SDK under installs/elixir/1.5.2Hope this helps!
Is "Erlang SDK for Elixir SDK" different than Erlang SDK? It didn't seem like Elixir actually cared. The main thing that helped was the symlinking to /usr/local/bin, as it does not seem to actually use the Erlang SDK path when it tries to find Erlang? Anyone, thanks for your tips!
"Erlang SDK for Elixir SDK" is the one supplied by this intellij-elixir plugin. "Erlang SDK" is the one supplied by the intellij-erlang plugin. I had to make the "Erlang SDK for Elixir SDK" for people that don't install the intellij-erlang plugin.
I was facing the same problem, but after setting elixir & erlang version as global it stopped to happen.
Most helpful comment
Also, it would be great if the plugin would read
.tool-versions(file created by asdf) and setup elixir automatically.