elixir-tools / next-ls

The language server for Elixir that just works. Ready for early adopters!
https://www.elixir-tools.dev/next-ls
MIT License
691 stars 41 forks source link

(BadMapError) expected a map, got: nil #535

Closed dan-klasson closed 1 month ago

dan-klasson commented 1 month ago

In my next-ls log when starting Zed I get this:

15:15:57.136 [error] ** (BadMapError) expected a map, got: nil
    (stdlib 5.2.3) :maps.merge(%{}, nil)
    (next_ls 0.22.8) lib/next_ls.ex:1005: anonymous fn/2 in NextLS.handle_notification/2
    (elixir 1.16.3) lib/map.ex:916: Map.update!/3
    (next_ls 0.22.8) lib/next_ls.ex:1005: NextLS.handle_notification/2
    (gen_lsp 0.10.0) lib/gen_lsp.ex:478: anonymous fn/2 in GenLSP.loop/3
    (telemetry 1.2.1) /private/tmp/next-ls-20240531-10295-xqrzy1/next-ls-0.22.8/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
    (gen_lsp 0.10.0) lib/gen_lsp.ex:474: anonymous fn/7 in GenLSP.loop/3
    (gen_lsp 0.10.0) lib/gen_lsp.ex:553: GenLSP.attempt/4

Installed with Brew

PJUllrich commented 1 month ago

Same here. This is how the error looks in the overall logs:

2024-08-13T10:11:49.212501Z [ERROR] failed to format via language server

Caused by:
    ** (CaseClauseError) no case clause matching: :timeout
        (gen_lsp 0.10.0) lib/gen_lsp.ex:353: anonymous fn/7 in GenLSP.loop/3
        (gen_lsp 0.10.0) lib/gen_lsp.ex:553: GenLSP.attempt/4
        (stdlib 6.0) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
xmyst commented 1 month ago

@PJUllrich to be fair, your error is clearly different from the OP's one. It might make sense to file a separate issue.

iampeter commented 1 month ago

Getting the same as @dan-klasson.

PJUllrich commented 1 month ago

@xmyst it's the same error, just viewed from a different log file. OP showed the error from the LSP's log file whereas mine is from Zed's log file.

iampeter commented 1 month ago

@mhanberg in the light of the merge of the 3 language servers, what should we expect to happen with this issue? thanks