JakeBecker / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the JSON-based "Language Server Protocol" standard and provides debugger support via VS Code's debugger protocol.
Apache License 2.0
846 stars 52 forks source link

"Failed to run "elixir" command ElixirLs will probably fail to launch #204

Closed matisnape closed 4 years ago

matisnape commented 4 years ago

Environment

Crash report template

When I open VSCode, the first thing I see is "Failed to run "elixir" command ElixirLs will probably fail to launch View > Output for "ElixirLS" shows that ElixirLS Dializer is working (it compiles project and shows warnings) However, formatting doesn't.

From what I've read elsewhere, the problem is with PATH, however, I'm not sure how can I address that - solutions I've found don't work - followed them here https://github.com/JakeBecker/vscode-elixir-ls/issues/86 (although my VSCode doesn't freeze).

I've started experiencing this after formatting my computer, upgrading to Catalina and setting everything from scratch - ZSH, asdf and VSCode with extensions. I have an office computer with the same setup (same .zshrc file), but only upgraded to Catalina, and there are no issues there.

This is how my outputs look like: image

odix67 commented 4 years ago

as a workaround place the .tool-versions file in your home directory, there is already an open issue (#109) regarding that issue

TreyE commented 4 years ago

as a workaround place the .tool-versions file in your home directory, there is already an open issue (#109) regarding that issue

This worked for me, but still doesn't solve the problem of having to replace my .tool-versions file in the home directory each time I open a new project (yuck). Is it possible we could manage to introduce, or there already is, a setting we could (ab)use to set the directory it loads the .tool-versions from?

I've looked at how the language server is invoked for the extension and compiled - it seems like we might need one instance of the language server running PER .tools-version elixir version value. I this something which would even be possible?

odix67 commented 4 years ago

Some news on this topic: you have to source the asdf.sh in .profile or .zprofile, after doing that, you are able to remove the .tool-versions file from your home directory, vs code complains just once that it could not run "elixir", don't know why, but the elixir-LS ist running and seems working Mark Ericksen mentioned this on one of his blog entries https://thinkingelixir.com/vs-code-broken-for-elixir/

btw, I'm using the ElixirLS Fork extension

matisnape commented 4 years ago

Some news on this topic: you have to source the asdf.sh in .profile or .zprofile, after doing that, you are able to remove the .tool-versions file from your home directory, vs code complains just once that it could not run "elixir", don't know why, but the elixir-LS ist running and seems working

I have . /usr/local/opt/asdf/asdf.sh in my ~/.zshrc file - is that it?

Using ElixirLS fork does not solve the issue for me

What worked was adding the versions in home's .tools-versions file 🎉

JakeBecker commented 4 years ago

This project has moved!

It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

To avoid inundating the new maintainers with issues, please verify that your issue persists with the latest version of the extension (which is published from the new repo) before re-filing your issue there.

Thanks for using ElixirLS!