Elixir IDEs and developer tools

I noticed you were using the Homebrew installed packages in the screenshot, so I tried on my daughter’s iMac which had nothing installed previously and is running Catalina. Did a fresh install of Homebrew, Erlang and Elixir and the latest version of RM. I had zero issues. Did you happen to ever set up Elixir via any other method (like ASDF, etc.)? Perhaps the Homebrew one is not active?

Deleting the .idea folder may help. I’ve had issues in the past trying to share an Elixir project with IntelliJ CE and RM. The .iml files are slightly different and it would screw up the second IDE you tried.

I did play around with VSCode today a little. Takes a lot of set up/plugins to get what comes natively with RM and IntelliJ Elixir…still missing a few things like the nice test runner, but it works. Im still partial to the JetBrains IDE’s though, maybe just familiarity.

If you are still interested in getting it going, file an issue with @KronicDeth on the plugin GitHub. He’s been super helpful when I’ve been stuck or had issues.

1 Like

Thanks for testing this out! I did manage to get it working too. First I reset the IDE to factory settings and then I noticed another step that I may have missed earlier: Under Preferences --> Languages & Frameworks --> Elixir --> SDKs, I managed to finally set an SDK (which was previously missing, so the reset seems to have helped with that), but then I also had to set the SDK under Preferences --> Languages & Frameworks --> Elixir (one level above Elixir SDKs). It works now, which is great. Oddly though some of the functionality that I’m used to isn’t working quite right, e.g. if I press Ctrl + T for refactoring, I get a pop up window that says “Refactor this: (1) Move file; (2) Copy file” rather than allowing me to rename the object. So I might stick with VS Code for now, but thank you again for looking into this!

You may need to close the project and reopen it. I’ve seen that sometimes where the language pack seems to get initialized only on project load. So if you changed the SDK and didn’t restart it, it hasn’t really fully loaded. Usually, it ‘just works’ for me though.

When I do ^T, this is what I see.

Screen Shot 2020-12-12 at 7.51.57 AM

Hm, restarting doesn’t seem to help. Just to clarify though, I can refactor a file name, but if, let’s say, I want to refactor a variable or a method, then I get the “Move/copy file” dialogue window.

Ah yeah. It probably won’t do that, at least in a small IDE, because it isn’t the native language.

Edit: Looking at the plugin’s doc’s, it only renames module attributes and params, but not methods. For that, you’d have to do a replace-all.

Also - there’s a vscode extension to bring in the IntelliJ keyboard shortcuts if you struggle with remapping muscle memory. (I may try it out myself on my next project)

1 Like

VS Code + ElixirLS + @spec, @spec, @spec ,@spec…and @spec :slight_smile: and then @type, @type:slight_smile:

then when you need to refactor, just change the function you need to schange or type spec. Then wait for dialiser to report problems in “problems” tab. Warrning, in many cases it will just say that function has no return, but you know that it is affected by change.

Problem is if you are working on project hat has a lot of warnings already and no specs at all

1 Like

I’m updating this thread to ask if there are any updates about another IDE than VS Code which works good with elixir. I don’t mean code syntax only, but also some higher function like “go to function”, highlighting compile/dialyzer/credo warnings or something like that.

I think every editor which supports LSP is a good fit

so any experience with Elixir with those?

sure, as elixirLS is an LSP implementation for elixir, I used it previously in VS Code, now with neovim, same behaviour, same functionality (regarding to elixir)

ohh, VIM and neovim is out of my skills. I’m really not good in vim style

I currently use Emacs. The latest (beta) release comes with out of the box support for elixir-ls. And even in the current stable release it is very easy to setup.

Although if you don’t like Vim I guess Emacs wouldn’t be your pick either :stuck_out_tongue:

1 Like

I used Zed for the last six months or so. Out of the box support for Elixir, go to function worked, inline compile warnings, and function docs.

The only thing I really missed with Zed was the plugin ecosystem and inline git blames.

1 Like

I mostly use vim but I’ve played around with Lapce and found it to work pretty well out of the box.

2 Likes

it didn’t have to be, just make small steps, it will you pay back later, a good guide for starting is to use the vi plugin in VS Code or the IntelliJ products or/and follow the guide from thePrimeagen Vim As Your Editor - YouTube
and by the way, you are afraid setting up neovim with a set of plugins, try https://www.lazyvim.org

Next to VSCode I also have AstroVim setup (neovim + astro), easy to setup and works also great, but nothing to my liking is better than VSCode at the moment.
So if vim is not your thing, currently there are not really better alternatives to my liking.

1 Like