Open chuygil opened 3 years ago
does the project compile in command line?
does the project compile in command line?
@amiralies Im just going over the guides on the elixir website right now, so I am not necessarily working with a project, but if I run a file using elixir
i've got this exact same issue. project compiles fine on CLI, but I always get the ElixirLS has crashed
error.
:CocOpenLog
shows this information:
2021-05-19T17:04:17.513 INFO (pid:29640) [services] - elixir state change: stopped => starting
2021-05-19T17:04:17.528 INFO (pid:29640) [plugin] - coc.nvim 0.0.80-971c5f81b4 initialized with node: v16.1.0 after 97ms
2021-05-19T17:04:17.532 INFO (pid:29640) [language-client-index] - Language server "elixir" started with 29673
2021-05-19T17:04:17.639 INFO (pid:29640) [attach] - receive notification: highlight []
2021-05-19T17:04:17.851 INFO (pid:29640) [services] - elixir state change: starting => running
2021-05-19T17:04:17.855 INFO (pid:29640) [services] - service elixir started
2021-05-19T17:04:19.603 INFO (pid:29640) [services] - elixir state change: running => stopped
2021-05-19T17:04:19.603 INFO (pid:29640) [services] - elixir state change: stopped => starting
2021-05-19T17:04:19.605 INFO (pid:29640) [language-client-index] - Language server "elixir" started with 29747
2021-05-19T17:04:19.926 INFO (pid:29640) [services] - elixir state change: starting => running
2021-05-19T17:04:21.674 INFO (pid:29640) [services] - elixir state change: running => stopped
2021-05-19T17:04:21.674 INFO (pid:29640) [services] - elixir state change: stopped => starting
2021-05-19T17:04:21.677 INFO (pid:29640) [language-client-index] - Language server "elixir" started with 29799
2021-05-19T17:04:21.996 INFO (pid:29640) [services] - elixir state change: starting => running
2021-05-19T17:04:23.741 INFO (pid:29640) [services] - elixir state change: running => stopped
2021-05-19T17:04:23.741 INFO (pid:29640) [services] - elixir state change: stopped => starting
2021-05-19T17:04:23.743 INFO (pid:29640) [language-client-index] - Language server "elixir" started with 29872
2021-05-19T17:04:24.073 INFO (pid:29640) [services] - elixir state change: starting => running
2021-05-19T17:04:25.844 INFO (pid:29640) [services] - elixir state change: running => stopped
2021-05-19T17:04:25.844 INFO (pid:29640) [services] - elixir state change: stopped => starting
2021-05-19T17:04:25.846 INFO (pid:29640) [language-client-index] - Language server "elixir" started with 29959
2021-05-19T17:04:26.195 INFO (pid:29640) [services] - elixir state change: starting => running
2021-05-19T17:04:28.755 INFO (pid:29640) [services] - elixir state change: running => stopped
2021-05-19T17:06:47.866 INFO (pid:29640) [attach] - receive notification: openLog []
2021-05-19T17:06:48.056 INFO (pid:29640) [attach] - receive notification: highlight []
2021-05-19T17:07:01.137 INFO (pid:29640) [attach] - receive notification: highlight []
I've tried mix local.rebar
but to no avail. I haven't worked on an elixir project for a few months, and has been happening for the last week or so. I even upgraded elixir but it doesn't seem to help.
This is neovim: NVIM v0.5.0-dev+1282-gfbe18d9ca
I tracked down my issue to the fact that I had a newer version of elixir installed than mix local.rebar
's version was installing. so it was an erlang/OTP mismatch. I switched to using asdf
to manage my elixir install and installed 1.13.0
and everything works, now, for me.
I have the same issue as @spikegrobstein, since upgrading Elixir with asdf
from 1.11.*
to 1.12.*
(from OTP 23 to 24). But my rebar and Elixir/OTP versions aren't mismatched as far as I can tell.
Edit: I found the answer here https://github.com/elixir-lsp/coc-elixir/issues/29, namely following these instructions: https://github.com/elixir-lsp/coc-elixir#server-fails-to-start
git clone https://github.com/elixir-lsp/elixir-ls.git ~/.elixir-ls
cd ~/.elixir-ls
mix deps.get && mix compile && mix elixir_ls.release -o release
coc-elixir
to the new installationOpen coc-settings.json
:
:CocConfig
Add this line:
{
"elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh"
}
Paul's solution worked for me but I also had to mix local.rebar
to fix a Could not compile dependency :forms
error after recompile/update/clean didn't work for me.
dnf install erlang-erl_interface
fixed a similar compile error for me.
I keep getting the following error, "[coc.nvim] The "elixir" server crashed 5 times in the last 3 minutes. The server will not be restarted."
VERSION: Erlang/OTP 23 [erts-11.1.7] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Elixir 1.11.2 (compiled with Erlang/OTP 23)
I made sure mix and elixir when in $PATH
I tried to troubleshoot by following the server fails to start section, but was unable to build successfully, getting the following error when compiling.