Hello all,
I’m learning Elixir and thank you for your patience and also for the help received in other threads.
I use both a Mac and a PC laptop.
I would ask you for some suggestions on how could I setup a useful developing enviroment.
I started with Sublime Text, which I love, but I saw that many people use VS Code, where there a lot of tools.
So I moved to VS Code.
I read this article:
and downloaded some extensions.
It appears that a couple of extensions are incompatible: Warning: mjmcloug.vscode-elixir is not compatible with ElixirLS, please uninstall mjmcloug.vscode-elixir
So I will unistall mjmcloug.vscode-elixir
I try to run the code in PowerShell (that is the default terminal in VS Code), but it doesn’t work.
The error message is in Italian (so it will be unuseful to copy and paste here), but it says that no application is associated with ex and exs: how can I fix this (I’m not neither expert
in PowerShell).
Any other suggestion about the way in which I can setup a productive enviroment?
If you’re running on the Mac, you should certainly use bash instead of powershell. VSCode allows you to select the default shell. I would do that as a first step.
On windows the experience is better if you use WSL but I do it all on the windows side when I’m making things to run on windows. I would suggest using windows terminal and installing powerline fonts. If you want tab completion and aren’t using WSL, start the shell with iex.bat --werl.
The only vscode extentions I’m using are elixir-ls and the dark elixir colour theme.
Thank you for your suggestions.
I installed WSL with Debian.
Still, I have some problems with users’ permissions and mount-points, but I’m fixing them.
here are the docs for windows terminal. I use ubuntu for WSL and have never had to worry about mount points or permissions. It all worked out of the box. You might want to check if you’re on WSL 1 or 2, and likely upgrade to 2 if you’re not there already, docs here.
Are you starting VS Code from within the WSL terminal with code .?
Are the extensions installed within WSL? You have to install them twice, once in Windows and once in WSL. See how there are two sections for the extensions.
After you’ve edited it, you should be able to run it with elixir testbed.exs. Honestly, I’ve never tried to run things from vscode but I’m sure its possible. This person shows how to setup debug. I generally play around in iex and run tests in a mix project.
Almost 2 years later, this is how I got things working using Visual Studio Community Edition 2022. I don’t use WSL2 as i find it too slow. This approach seems clumsy to me, hopefully someone will a more sane approach.
Optionally to make the ElixirLS available in the powershell under elixir-ls, e.g. for Vim:
Download ElixirLS and extract under C:\Program Files(x86)\elixir-ls
2 Add the following to the powershell profile.ps1: Set-Alias -Name elixir-ls -Value "C:\Program Files (x86)\elixir-ls\language_server.bat"