JakeBecker / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
391 stars 42 forks source link

Working dir and asdf #109

Closed quolpr closed 4 years ago

quolpr commented 6 years ago

Vscode-Elixir-ls version - 0.2.23 Vscode - 1.28.0 Asdf - 0.4.1 System Version - macOS 10.14 (18A391) .tool-versions:

elixir 1.7.3-otp-21
erlang 21.0.8

And elixir is working fine from terminal.

I am getting this error on elixir ls start:

Failed to run 'elixir' command. Current process's PATH: /Users/quolpr/.rvm/gems/ruby-2.4.1/bin:/Users/quolpr/.rvm/gems/ruby-2.4.1@global/bin:/Users/quolpr/.rvm/rubies/ruby-2.4.1/bin:/Users/quolpr/.asdf/bin:/Users/quolpr/.asdf/shims:/usr/local/opt/erlang@18/bin:/Users/quolpr/google-cloud-sdk/bin:/Users/quolpr/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/quolpr/.rvm/bin:/Users/quolpr/golang:/usr/local/opt/go/libexec/bin

Failed to run 'elixir' command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

As you can notice, asdf shim is present in PATH. Then, when I try to exec the elixir from dev console, I get:

try {
    c.execSync("elixir -v");
} catch (err) {
    console.log(err.stdout.toString());
    // etc
}

// No version set for elixir

And, strange thing:

c.execSync("echo $PWD").toString()
// "/"

So, working dir is /, but actually it should be the dir of the current project 🤔

quolpr commented 6 years ago

And the really strange things - previously it was working ok, but I didn't notice when it broke down. Maybe on mac os update or maybe on vscode update

quolpr commented 6 years ago

Also, I think it will be better to add this code to the extension:

} catch (err) {
    console.log(err.stdout.toString());
    // etc
}

So the reason will be logged to console too

quolpr commented 6 years ago

Temporary fix - put elixir/erlang versions to ~/.tool-versions. It will work as global default

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/vscode-elixir-ls. The main ElixirLS codebase is now 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.

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!