which extensions?
ElixirLS has the option: “Project Dir: ubdirectory containing Mix project if not in the project root
Value must be 1 or more characters long.”.
(I had “.” in that field, had to left it blank or the extension didn’t work.)
Maybe your problem has something to do with that.
It seems that whatever starts the LS, and therefore the LS and everything it starts, has a malformed view on one of these system variables:
XDG_CONFIG_HOME or XDG_DATA_HOME
MIX_HOME
HOME
When you run eg mix archive.install hex phx_new from a terminal, what does happen then? In that same terminal, what are the values of these environment variable mentioned above?
By running code . in the terminal from within the relevant directory. I should note that this has been working fine until fairly recently.
The same problem occurs in more than one folder, incidentally. In the first, I’m using direnv and kiex to manage Elixir; in the second, it’s the system default (1.10.2).
Which suggests that Mix.Utils.mix_home() is returning an invalid value. But if I run iex -S mix in the VS Code terminal, that function returns /home/roger/.mix, as expected.
Seems like you are using the original ElixirLS extension, which is not receiving updates anymore. I don’t know if this will solve your problem, but take a look at ElixirLS Fork.
Fixed it. ElixirLS recently started honouring asdf configuration. A while back I switched from asdf to direnv and my asdf configuration was apparently broken, resulting in MIX_HOME=/.