elixir-lsp / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
https://elixir-lsp.github.io/elixir-ls/
Apache License 2.0
1.5k stars 196 forks source link

Not starting on OTP26 #886

Closed lukaszsamson closed 1 year ago

lukaszsamson commented 1 year ago

There are several issues that make ElixirLS fail on OTP26. Some of them are already addressed on https://github.com/elixir-lsp/elixir-ls/tree/otp26 but some will need to wait for fixes upstream

Hermanverschooten commented 1 year ago

Hi, I just wanted to add that it does not work with the released version of Erlang 26.0. I am running elixir-ls in LunarVim and get this in the LspLog

[START][2023-05-18 06:53:14] LSP logging initiated
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734    "rpc"   "elixir-ls" "stderr"    "Runtime termina"
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734    "rpc"   "elixir-ls" "stderr"    "ting during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})\r\n\r\nCrash dump is being written to: erl_crash.dump.."
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734    "rpc"   "elixir-ls" "stderr"    "."
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734    "rpc"   "elixir-ls" "stderr"    "done\r\n"
idyll commented 1 year ago

Even with the OTP26 branch with master merged in things are working much, much better ;)

lukaszsamson commented 1 year ago

Even with the OTP26 branch with master merged in things are working much, much better ;)

It crashes on first utf character in client request

idyll commented 1 year ago

Even with the OTP26 branch with master merged in things are working much, much better ;)

It crashes on first utf character in client request

I see one crash, and then it seems to work fine after that.. (where previously it would just crash repeatedly.) I merged master into a local copy of this branch and recompiled. I'm using Elixir 1.15 and OTP 26.0.1

Not saying it's fixed. But it's actually usable right now for me...

dvic commented 1 year ago

FYI, the last open bug in OTP 26 has just been closed 🎉

lukaszsamson commented 1 year ago

Now we need an OTP release OTP-26.0.2 with the fix and find a way how to pass -standard_io_encoding latin1 to launch scripts

garazdawi commented 1 year ago

It would be great if you could test the latest maint before we release 26.0.2 and see if there are any more issues so that we can fix them as well. The plan is to release 26.0.2 early next week.

wkirschbaum commented 1 year ago

Elixir 1.15.0 (compiled with Erlang/OTP 26) Linux version 6.3.8-arch1-1 (linux@archlinux) (gcc (GCC) 13.1.1 20230429, GNU ld (GNU Binutils) 2.40.0)

Just compiled and installed maint and getting the following error:

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[<<42,42,32,40,69,88,73,84,32,102,114,111,109,32,35,80,73,68,60,48,46,57,56,46,48,62,41,32,97,110,32,101,120,99,101,112,116,105,111,110,32,119,97,115,32,114,97,105,115,101,100,58,10,32,32,32,32,42,42,32,40,69,114,108,97,110,103,69,114,114,111,114,41,32,69,114,108,97,110,103,32,101,114,114,111,114,58,32,58,99,97,108,108,105,110,103,95,115,101,108,102,58,32,117,110,107,110,111,119,110,32,101,114,114,111,114,58,32,99,97,108,108,105,110,103,95,115,101,108,102,10,32,32,32,32,32,32,32,32,40,115,116,100,108,105,98,32,53,46,48,46,49,41,32,105,111,46,101,114,108,58,57,57,58,32,58,105,111,46,112,117,116,95,99,104,97,114,115,40,58,115,116,97,110,100,97,114,100,95,101,114,114,111,114,44,32,91,34,42,42,32,40,82,117,110,116,105,109,101,69,114,114,111,114,41,32,85,110,97,98,108,101,32,116,111,32,114,101,97,100,32,102,114,111,109,32,100,101,118,105,99,101,58,32,58,116,101,114,109,105,110,97,116,101,100,34,44,32,49,48,44,32,34,32,32,32,32,40,101,108,105,

Crash dump is being written to: erl_crash.dump...done

This is with what sounds to a the fix: https://github.com/erlang/otp/commit/bf1916dbbecb74c8315c83ffabf412ee36aef6d4

with the flag set as --erl "-kernel standard_io_encoding latin1" ... ( not sure if this is right ).

I also tested the credo-language-server over stdio which is working as expected.

dmilith commented 1 year ago

On macOS 12.6/arm64 I get:

Running /usr/local/elixir-language-server/launch.sh
Looking for ASDF install in /Users/dmilith/.asdf/asdf.sh
Installing ElixirLS release v0.15.0
Running in /Volumes/Projects/Sofin
Install complete
Content-Length: 103

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.15.0","type":3}}Content-Length: 113

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running in /Volumes/Projects/Sofin","type":3}}Content-Length: 130

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS built with elixir \"1.15.0\" on OTP \"26\"","type":3}}Content-Length: 151

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running on elixir \"1.15.0 (compiled with Erlang/OTP 26)\" on OTP \"26\"","type":3}}Content-Length: 109

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Content-Length: 194

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

Wonder how or where you can set the path for the Elixir source… but I think it's our last problem here ;)

lukaszsamson commented 1 year ago

Instead of posting the same crash log again and again what would actually help here would be testing the new flag added on OTP master.

dmilith commented 1 year ago

Nope. With the Otp master from today (2023-06-25 18:45 CEST):

Generated erl2ex app
Install complete
Content-Length: 103

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.15.0","type":3}}Content-Length: 113

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running in /Volumes/Projects/Small","type":3}}Content-Length: 130

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS built with elixir \"1.15.0\" on OTP \"26\"","type":3}}Content-Length: 151

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running on elixir \"1.15.0 (compiled with Erlang/OTP 26)\" on OTP \"27\"","type":3}}Content-Length: 109

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Content-Length: 194

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[<<42,42,32,40,69,88,73,84,32,102,114,111,109,32,35,80,73,68,60,48,46,57,56,46,48,62,41,32,97,110,32,101,120,99,101,112,116,105,111,110,32,119,97,115,32,114,97,105,115,101,100,58,10,32,32,32,32,42,42,32,40,69,114,108,97,110,103,69,114,114,111,114,41,32,69,114,108,97,110,103,32,101,114,114,111,114,58,32,58,99,97,108,108,105,110,103,95,115,101,108,102,58,32,117,110,107,110,111,119,110,32,101,114,114,111,114,58,32,99,97,108,108,105,110,103,95,115,101,108,102,10,32,32,32,32,32,32,32,32,40,115,116,100,108,105,98,32,53,46,48,46,49,41,32,105,111,46,101,114,108,58,57,57,58,32,58,105,111,46,112,117,116,95,99,104,97,114,115,40,58,115,116,97,110,100,97,114,100,95,101,114,114,111,114,44,32,91,34,42,42,32,40,82,117,110,116,105,109,101,69,114,114,111,114,41,32,85,110,97,98,108,101,32,116,111,32,114,101,97,100,32,102,114,111,109,32,100,101,118,105,99,101,58,32,58,116,101,114,109,105,110,97,116,101,100,34,44,32,49,48,44,32,34,32,32,32,32,40,101,108,105,

Crash dump is being written to: erl_crash.dump...done

Unfortunately, the process crashes very similar fashion as before.

lukaszsamson commented 1 year ago

Are you running with --erl "-kernel standard_io_encoding latin1"? Also OTP26 branch has other changes that may be needed

lukaszsamson commented 1 year ago

I added -kernel standard_io_encoding latin1 to launch scripts and it seems to be working OK with maint OTP branch. ElixirLS changes in https://github.com/elixir-lsp/elixir-ls/tree/otp26 branch. I'm going to run some more tests and cleanup the patch before it's ready for merging

lukaszsamson commented 1 year ago

Fixed in https://github.com/elixir-lsp/elixir-ls/pull/923

axelson commented 1 year ago

@lukaszsamson congratulations on getting this fixed! :tada:

Quick question, are there specific versions of OTP 26 that still aren't supported after this change? i.e. is OTP 26.0.1 required? If so then we may want to add that info to the README or ideally add a warning if we detect that we're running on an unsupported version of OTP (although maybe that's not feasible).

lukaszsamson commented 1 year ago

The OTP fix is attached to 26.0.2 milestone. I'll update the readme when it's out

Fudoshiki commented 1 year ago

Release a new version of the vs code extension?

wkirschbaum commented 1 year ago

@lukaszsamson thank you for the effort ❤️. I can confirm it is working, so I must have done the flag wrong.

moogle19 commented 1 year ago

@lukaszsamson OTP 26.0.2 just released! 🙂

nallwhy commented 1 year ago

I still have the problem with OTP 26.0.2, Elixir 1.15.0-otp-26.

Maybe VSCode installs v0.15.0 yet, not v0.15.1.

Running /Users/json/.vscode/extensions/jakebecker.elixir-ls-0.15.1/elixir-ls-release/launch.sh
Looking for ASDF install in /opt/homebrew/Cellar/asdf/0.12.0/libexec/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /opt/homebrew/Cellar/asdf/0.12.0/libexec/asdf.sh
Sourcing ASDF
Installing ElixirLS release v0.15.0
Running in <path>
Install complete
[Info  - 11:18:42 PM] Started ElixirLS v0.15.0
[Info  - 11:18:42 PM] Running in <path>
[Info  - 11:18:42 PM] ElixirLS built with elixir "1.15.0" on OTP "26"
[Info  - 11:18:42 PM] Running on elixir "1.15.0 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 11:18:42 PM] Protocols are not consolidated
[Warn  - 11:18:42 PM] OTP compiled without EEP48 documentation chunks. Language features for erlang modules will run in limited mode. Please reinstall or rebuild OTP with appropriate flags.
[Info  - 11:18:42 PM] Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
[Error - 11:18:44 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:18:44 PM] Connection to server got closed. Server will restart.
true
[Error - 11:18:44 PM] ElixirLS - <app> client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
lukaszsamson commented 1 year ago

There were no ElixirLS release yet

lukaszsamson commented 1 year ago

Unfortunately OTP 26 is still broken on Windows https://github.com/elixir-lsp/elixir-ls/issues/927

adonig commented 1 year ago

I'm running into the same error like @nallwhy on Fedora Linux 37 with VSCodium 1.79.2. Everything works with Erlang 25.3.2 and Elixir 1.14.5-otp-25. When I switch to Erlang 26.0.2 and Elixir 1.15.2-otp-26 this happens:

Running /home/asd/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/launch.sh
Looking for ASDF install in /home/asd/.asdf/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /home/asd/.asdf/asdf.sh
Sourcing ASDF
Installing ElixirLS release v0.15.0
Running in /home/asd/Code/smtc/apix
Install complete
[Info  - 8:38:12 AM] Started ElixirLS v0.15.0
[Info  - 8:38:12 AM] Running in /home/asd/Code/smtc/apix
[Info  - 8:38:12 AM] ElixirLS built with elixir "1.15.2" on OTP "26"
[Info  - 8:38:12 AM] Running on elixir "1.15.2 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 8:38:12 AM] Protocols are not consolidated
[Info  - 8:38:12 AM] Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
[Error - 8:38:14 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 8:38:14 AM] The ElixirLS - apix server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 8:38:14 AM] ElixirLS - apix client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 8:38:14 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

I already tried deleting the .elixir_ls and _build directories but it didn't help. I can provide the erl_crash.dump if you want.

lukaszsamson commented 1 year ago

@adonig Please read release notes carefully. OTP 26 is supported since 0.15.1 and you are running 0.15.0

Installing ElixirLS release v0.15.0
adonig commented 1 year ago

@lukaszsamson I'm not intentionally running 0.15.0. It looks like I'm running 0.15.1 and it's installing 0.15.0, see here:

Running /home/asd/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/launch.sh

I believe it's the same problem@nallwhy has. He's also running 0.15.1 and then it's installing 0.15.0 for some reason.

EDIT: So I went into the folder /home/asd/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/ and read the source code of installer.exs and it looks like it gets the version from the VERSION file in the same folder and there the version 0.15.0 is hardcoded:

[asd@fwk elixir-lsp.elixir-ls-0.15.1-universal]$ cat elixir-ls-release/VERSION 
0.15.0

EDIT2: I changed the contents of the VERSION file manually to 0.15.1 and now everything works:

Running /home/asd/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/launch.sh
Looking for ASDF install in /home/asd/.asdf/asdf.sh
ASDF found, relaunching in bash shell
Looking for ASDF install in /home/asd/.asdf/asdf.sh
Sourcing ASDF
Installing ElixirLS release v0.15.1
Running in /home/asd/Code/smtc/apix
* Getting elixir_ls (https://github.com/elixir-lsp/elixir-ls.git - v0.15.1)
* Getting elixir_sense (https://github.com/elixir-lsp/elixir_sense.git - a50b8b616833fac6b45dbb65d6a8c6d9fda3a038)
* Getting erl2ex (https://github.com/dazuma/erl2ex.git)
* Getting dialyxir_vendored (https://github.com/elixir-lsp/dialyxir.git - 7e908b4d760c7329046e0ee3076be9156cd784e1)
* Getting jason_v (https://github.com/elixir-lsp/jason.git - c81537e2a5e1acacb915cf339fe400357e3c2aaa)
* Getting path_glob_vendored (https://github.com/elixir-lsp/path_glob.git - origin/vendored)
* Getting mix_task_archive_deps (https://github.com/elixir-lsp/mix_task_archive_deps.git)
Resolving Hex dependencies...
Resolution completed in 0.036s
New:
  benchee 1.1.0
  deep_merge 1.0.0
  erlex 0.2.6
  nimble_parsec 1.1.0
  patch 0.12.0
  statistex 1.0.0
  stream_data 0.5.0
* Getting stream_data (Hex package)
* Getting patch (Hex package)
* Getting benchee (Hex package)
* Getting deep_merge (Hex package)
* Getting statistex (Hex package)
* Getting nimble_parsec (Hex package)
* Getting erlex (Hex package)
==> jason_v
Compiling 10 files (.ex)
Generated jason_v app
==> nimble_parsec
Compiling 4 files (.ex)
Generated nimble_parsec app
==> path_glob_vendored
Compiling 2 files (.ex)
Generated path_glob_vendored app
==> mix_task_archive_deps
Compiling 5 files (.ex)
Generated mix_task_archive_deps app
==> elixir_sense
Compiling 56 files (.ex)
Generated elixir_sense app
==> erl2ex
Compiling 22 files (.ex)
warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_forms.ex:265:16

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:251:7

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:258:7

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:605:20

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:610:20

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:616:20

warning: atom ::: must be written between quotes, as in :"::", to avoid ambiguity
  lib/erl2ex/convert/erl_expressions.ex:616:57

warning: Macro.to_string/2 is deprecated. Use Macro.to_string/1 instead
  lib/erl2ex/pipeline/codegen.ex:505: Erl2ex.Pipeline.Codegen.expr_to_string/1

Generated erl2ex app
==> erlex
Compiling 1 file (.yrl)
Compiling 1 file (.xrl)
Compiling 2 files (.erl)
Compiling 1 file (.ex)
Generated erlex app
==> dialyxir_vendored
Compiling 64 files (.ex)
Generated dialyxir_vendored app
==> elixir_ls_utils
Compiling 8 files (.ex)
Generated elixir_ls_utils app
==> elixir_ls_debugger
Compiling 12 files (.ex)
Generated elixir_ls_debugger app
==> language_server
Compiling 235 files (.ex)
warning: Macro.to_string/2 is deprecated. Use Macro.to_string/1 instead
Invalid call found at 2 locations:
  lib/language_server/providers/execute_command/manipulate_pipes/ast.ex:75: ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipes.AST.ast_to_string/1
  lib/language_server/providers/execute_command/manipulate_pipes/ast.ex:149: ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipes.AST.interpolate/4

warning: :dialyzer_plt.from_file/1 is undefined or private
Invalid call found at 2 locations:
  lib/language_server/dialyzer/manifest.ex:132: ElixirLS.LanguageServer.Dialyzer.Manifest.load_elixir_plt/0
  lib/language_server/dialyzer/manifest.ex:185: ElixirLS.LanguageServer.Dialyzer.Manifest.build_elixir_plt/0

Generated language_server app
Install complete
[Info  - 10:27:01 AM] Started ElixirLS v0.15.1
[Info  - 10:27:01 AM] Running in /home/asd/Code/smtc/apix
[Info  - 10:27:01 AM] ElixirLS built with elixir "1.15.2" on OTP "26"
[Info  - 10:27:01 AM] Running on elixir "1.15.2 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 10:27:01 AM] Protocols are not consolidated
[Info  - 10:27:01 AM] Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.
[Info  - 10:27:01 AM] Loaded DETS databases in 18ms
[Info  - 10:27:01 AM] Starting build with MIX_ENV: test MIX_TARGET: host
===> Analyzing applications...

I'm not sure why there is the old version in that file. I believe I even deleted the whole /home/asd/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal directory and did a clean reinstall of the ElixirLS extension like a week ago because I just couldn't get OTP26 working.

lukaszsamson commented 1 year ago

@adonig the release asset https://github.com/elixir-lsp/elixir-ls/releases/download/v0.15.1/elixir-ls-v0.15.1.zip includes a correct 0.15.1 version manifest

lukaszsamson commented 1 year ago

If you only modify the version you will end up using launch scripts from some other release which may be incomptatible

adonig commented 1 year ago

@lukaszsamson I uninstalled ElixirLS in VSCodium but it didn't remove the folder elixir-lsp.elixir-ls-0.15.1-universal in ~/.vscode-oss/extensions/. So I deleted the folder. Then I installed ElixirLS in VSCodium again and I immediately get the error again. When I check the VERSION file it contains the old version again:

[asd@fwk ~]$ cat $HOME/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/VERSION 
0.15.0

I don't know whether this is because I'm using VSCodium and they get their release assets from another place or whether there is some kind of extension release asset cache in VSCode that prevents it from downloading the new release asset.

lukaszsamson commented 1 year ago

You are installing the wrong version once again. VSCode plugin versioning is independent from elixirLS versioning. You need 0.15.2 https://github.com/elixir-lsp/vscode-elixir-ls/blob/master/CHANGELOG.md#v0152-29-june-2023

adonig commented 1 year ago

It looks like the newest version available is 0.15.1:

asd@fwk ~]$ codium --install-extension elixir-lsp.elixir-ls
Installing extensions...
Installing extension 'elixir-lsp.elixir-ls'...
(node:2209612) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `codium --trace-deprecation ...` to show where the warning was created)
Extension 'elixir-lsp.elixir-ls' v0.15.1 was successfully installed.
[asd@fwk ~]$ codium --list-extensions --show-versions | grep elixir
elixir-lsp.elixir-ls@0.15.1
[asd@fwk ~]$ codium --uninstall-extension elixir-lsp.elixir-ls
Uninstalling elixir-lsp.elixir-ls...
Extension 'elixir-lsp.elixir-ls' was successfully uninstalled!
[asd@fwk ~]$ codium --install-extension elixir-lsp.elixir-ls@0.15.2
Installing extensions...
Extension 'elixir-lsp.elixir-ls@0.15.2' not found.
Make sure you use the full extension ID, including the publisher, e.g.: ms-dotnettools.csharp
Failed Installing Extensions: elixir-lsp.elixir-ls

So I probably have to install it like described in the installation section of the README because it didn't get released yet?

Sorry for the turmoil but because of the vscode extension version 0.15.1 I thought that I'm installing ElixirLS 0.15.1 all the time.

jesse-c commented 1 year ago

Thank you @lukaszsamson for your patience. Since these issues are not related to ElixirLS itself, they could be moved to the vscode-elixir-ls repository, if there is indeed an issue?

garazdawi commented 1 year ago

I've done a fix for the Windows issue in https://github.com/erlang/otp/pull/7473. Would be great if you could test that both Unix and Windows still work as they should for ElixirLS.

garazdawi commented 1 year ago

Fix merged, but I'll hold of making a patch until I get confirmation here (or in erlang/otp#7473) that the fix solves the issue and that no new ones have popped up.

dr1ver1 commented 1 year ago

Maybe this should be pinned to the top of Open Issues, and maybe the title should be renamed to "elixlir-ls on OTP26 does not work in VSCode" or "Don't upgrade to OTP26 with VSCode". I'm new to Elixir (so I haven't upgraded from a previous version), and it took me some time to:

i.e. for someone new to Elixir, being a bit more explicit about the problem would be helpful

lukaszsamson commented 1 year ago

@dr1ver1 It is already pinned since OTP 26 rc.3 release and mentioned both in release notes and README. There were at least ten threads on the forum and messages on slack. It does not stop people from running on incompatible versions and raising issues...

dr1ver1 commented 1 year ago

ok. I was looking through issues at https://github.com/elixir-lsp/vscode-elixir-ls/issues I guess I was looking in the wrong place

axelson commented 1 year ago

@dr1ver1 I've added a pinned issue to that repo for additional visibility: https://github.com/elixir-lsp/vscode-elixir-ls/issues/365

jschaeff commented 1 year ago

Hello, I'm not sure to help here, but I wanted to report that elixir-ls 0.16 still fails on Archlinux with OTP26. By following this issue, I expected that the remaining problem was only for windows and the others were already fixed in 1.16 release. Is there a branch of elixir-ls that works on linux with OTP 26 ?

This is my error message when running in emacs with lsp-mode:

Process elixir-ls stderr finished
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
lukaszsamson commented 1 year ago

@jschaeff Please make sure you run OTP >= 26.0.2

jschaeff commented 1 year ago

Yes it's OTP 26.0.2

lukaszsamson commented 1 year ago

Please post more logs. Can you create a dockerfile that reproduces it?

lobo-tuerto commented 1 year ago

Latest version of elixir-ls (v0.16.0) runs without problems on Linux with the following versions:

lukaszsamson commented 1 year ago

OTP 26.1 is out with the fix for https://github.com/erlang/otp/issues/7459, I'll test it out later

jschaeff commented 1 year ago

Please post more logs. Can you create a dockerfile that reproduces it?

It's hard to make a docker container that mimic's the dialog between emacs lsp-mode and elixir-ls, but it lead me to another path: by switching from lsp-mode to eglot, I got it working. This is a bit weird ... but then maybe it's an lsp-mode bug ?

Sidenote: It's also a bit weird that archlinux is so much behind in the elixir package (1.15.0)

Hermanverschooten commented 1 year ago

I have just tested erlang 26.1/elixir 1.15.4 with 0.16 in one of my projects, it works but some vim restarts were necessary. I removed both my _build and .elixir_ls upfront, but that's something I always do when switching versions. Oh and I am using rtx not asdf, on Mac OS Ventura 13.5.2 M2.

garazdawi commented 1 year ago

OTP 26.1 is out with the fix for https://github.com/erlang/otp/issues/7459, I'll test it out later

I'm curious, why wait for the release to test it? If you had tested my PR and confirmed that it fixed the problem I would have released a patch with this fix 2 months ago.

lukaszsamson commented 1 year ago

I can confirm that elixir-ls 0.16 with OTP 26.1 is working on windows

I'm curious, why wait for the release to test it? If you had tested my PR and confirmed that it fixed the problem I would have released a patch with this fix 2 months ago.

Let's put it like this: building OTP on windows isn't the easiest of tasks

garazdawi commented 1 year ago

Let's put it like this: building OTP on windows isn't the easiest of tasks

Each PR opened towards our repository creates an .exe installer that can be used for testing. There is link to it in the auto-generated comment: https://github.com/erlang/otp/pull/7473#issuecomment-1620327191

lukaszsamson commented 1 year ago

I'm closing the issue as now all main OSes are working with OTP 26

lukaszsamson commented 1 year ago

Another OTP related issue https://github.com/elixir-lsp/elixir-ls/issues/1023