IVR

IVR OP

Hi all, I’m new here and I’d like to apologise if this question isn’t exactly original, however, I haven’t found a satisfactory answer to my questions, so I’m posting this here anyway.

I’m getting started with Elixir and I haven’t quite figured out what IDE to use with it. I’d like to understand what tools are other Elixir developers using and I’d also like to highlight problems that I ran into while setting up my development environment. We might not be able to resolve all of them, but perhaps we might be able to resolve at least one.

I come from an IntelliJ background and here is the summary of what I’ve tried and where I’ve experienced problems:

  • IntelliJ with the Elixir plugin: as I mentioned above, IntelliJ would be my preferred IDE, however even after installing the Elixir plugin and setting both Elixir and Erlang SDKs, IntelliJ isn’t complaining about anything but auto-completion and definition lookups don’t seem to work. I’ve found a number of related issues, like this one, but haven’t been able to resolve this problem.
  • RubyMine with the Elixir plugin: I thought this should be very similar to IntelliJ, but I ran into a different problem when using RubyMine, I got an error “Elixir Module SDK is not defined” and even though there is a button next to it that says “Setup Elixir Module SDK”, nothing happens when I click it. If I go into Preferences → Languages & Frameworks → Elixir → SDKs and if I try to set an Elixir SDK, I get an error “Cannot save settings: please specify a different SDK name”. At least here I had an error to work with, but after about 20 minutes I’ve given up and decided to try option 3 (below)
  • VS Code with the Elixir extension: This option works the best and I’m actually beginning to like VS Code. My biggest and so far the only problem is refactoring. In IntelliJ (or related tools) it’s as easy as Ctrl+T and all uses and definitions of the thing you are trying to refactor are updated, whereas in VS Code this seems like a major hassle. I’ve found ways to change a definition within a file but not throughout the project. If anyone has any suggestions here, then please let me know

Thank you all in advance for reading!

First 10 of 35 Posts Switch mode

rodesousa

rodesousa

I use neovim + coc with elixir extension

For a non vim user, it’s rough at begining but you have everything you need

crova

crova

Same here (although I’m actually using Vim + alchemist vim).
I found out that I needed way less setup/plugins to get everything I needed compared to my Ruby/RoR setup.

IVR

IVR OP

@crova and @rodesousa, thank you for sharing! I was hoping to get one of the JetBrains IDEs or VS Code working here, but if vim happens to be the objectively better option here, then I’ll consider switching further down the line. Either way, it’s good to know that there is a good solution out there even if I’m not a fan of it :slight_smile:

mpalmer

mpalmer

I’m pretty new to elixir as well, with a similar background as you (IntelliJ for most projects). I found that VSCode was (as you said) surprisingly nice. Refactoring is definitely a challenge, though I can’t say I have found it too much of an issue.

I work in a windows environment, though I prefer linux, and have found that WSL2 with alpine does everything I need. VSCode connects to it directly, and iex is much more pleasant (autocomplete works, pretty colors).

For me the biggest shift, coming from intellij and java and huge unwieldy codebases, is the simplicity. Building systems in Elixir (and they certainly feel and act like systems rather than plain old applications), somehow manages to organize complexity in a clean and manageable way. Having an IDE for Java is almost always necessary because there are often so many pieces flying around that it helps keep them all straight. With Elixir, it all just doesn’t seem so messy.

I hope this helps - your background definitely sounds a lot like mine, so I can understand the initial struggle to get comfortable with Elixir. But certainly it is worth every discomfort and mind-shift.

IVR

IVR OP

Great, thank you for sharing!

Your background does indeed seem similar to mine which means you’d probably understand how I ended up with a minor panic attack when I switched to a dynamic language with a fairly loose IDE :laughing: I have to agree that I haven’t found this to be a problem yet, I was just thinking about what happens further down the line because I would like to develop some stuff with Phoenix. Given the nature of the language, I can understand how my concerns may be exaggerated, so I’ll proceed with VS Code for now.

stiegi

stiegi

In VSCode I use CTRL + SHIFT + H to replace something in all files of the project, and then there is this tiny symbol next to the filenames that applies the change, it appears as soon as you select a file.

IVR

IVR OP

Ah, it works, excellent! It looks like there are a bunch of plugins for this and VS Code internal capabilities some of which just don’t work while others only work with specific languages, but this command seems to have done the trick. Thanks for sharing! BTW, for anyone using a Mac it’s CMD+SHIFT+H

drl123

drl123

FYI - have had a lot of success with using the Elixir plugin for Rubymine. It’s a little awkward to set the SDK, but after that, it works well. Under Languages in Preferences, click the arrow to expand Elixir and show the SDK options for Elixir and Erlang. Click the + under each and you’ll have to set the path by navigating to the appropriate directory where you have installed each. In my case, using ASDF, it’s under ~/.asdf/installs/elixir/<your version here>. Do this for Elixir under SDKs and Erlang under Internal Erlang SDKs. After that, you should see this version of Elixir in the SDK selection for the language (i.e. with the drop-down collapsed).

I haven’t gotten to try Vscode yet. I see a lot of folks using it, but I also use RM for my day job, so it’s more about familiarity than anything for me. The debugger works well for Elixir too.

axelson

axelson

Scenic Core Team

Personally, I use Doom Emacs with ElixirLS for development. But my general sense is that the majority of Elixir developers now use VSCode (and VSCode is significantly easier to get started with than Emacs). So VSCode is my general recommendation (with ElixirLS and not vscode-elixir since it is not maintained).

With Elixir, it is generally reasonable to use generic project-wide (and sometimes single-file) search and replace to refactor variable names. Or at least reasonable enough that no-one’s created tooling to do context-aware refactoring. But if someone were to implement refactoring in ElixirLS that would be much appreciated and could then be used across a large variety of editors.

IVR

IVR OP

Yeah, that’s what I tried originally, but that didn’t work. I get an error: “Cannot Save Settings: Please specify a different SDK name”. Based on quick research it means that the SDK is already set somewhere, but I’m not sure where. If I open an Elixir project, it warns me that there is no Elixir SDK and if I click on the corresponding button to “Set Elixir Module SDK” nothing happens.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement