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

no function clause matching in :elixir_erl.dynamic_form/1 #186

Closed AttilaGal closed 4 years ago

AttilaGal commented 5 years ago

I'm running into the following error message, some of the elixir-ls functionality is not working because of it (no automatic spec annotations)

Environment

10:07:46.043 [error] Task #PID<0.485.0> started from #PID<0.109.0> terminating ** (FunctionClauseError) no function clause matching in :elixir_erl.dynamic_form/1 (elixir) src/elixir_erl.erl:154: :elixir_erl.dynamic_form(%{attributes: [behaviour: Poison.Encoder, protocol_impl: [protocol: Poison.Encoder, for: Float]], compile_opts: [], definitions: [{{:encode, 2}, :def, [line: 230], [{[line: 230], [{:float, [line: 230], nil}, {:_options, [line: 230], nil}], [], {{:., [line: 231], [:io_lib_format, :fwrite_g]}, [line: 231], [{:float, [line: 231], nil}]}}]}, {{:impl, 1}, :def, [line: 229, context: Protocol], [{[line: 229, context: Protocol], [:for], [], Float}, {[line: 229, context: Protocol], [:target], [], Poison.Encoder.Float}, {[line: 229, context: Protocol], [:protocol], [], Poison.Encoder}]}], deprecated: [], file: "/Users/attilagal/Projects/digipolis/focus/squad-service/deps/poison/lib/poison/encoder.ex", line: 229, module: Poison.Encoder.Float, unreachable: []}) (elixir) src/elixir_erl.erl:18: :elixir_erl.debug_info/4 dialyzer_utils.erl:117: :dialyzer_utils.get_core_from_beam/2 (language_server) lib/language_server/dialyzer.ex:402: ElixirLS.LanguageServer.Dialyzer.module_md5/1 (language_server) lib/language_server/dialyzer.ex:250: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.update_stale/4 (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2 (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5 (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3 Function: &:erlang.apply/2 Args: [#Function<8.101579333/1 in ElixirLS.LanguageServer.Dialyzer.update_stale/4>, [".elixir_ls/build/test/lib/poison/ebin/Elixir.Poison.Encoder.Float.beam"]]

10:07:46.063 [error] Task #PID<0.502.0> started from #PID<0.109.0> terminating ** (FunctionClauseError) no function clause matching in :elixir_erl.dynamic_form/1 (elixir) src/elixir_erl.erl:154: :elixir_erl.dynamic_form(%{attributes: [], compile_opts: [], definitions: [{{:transform_struct, 4}, :defp, [line: 61], [{[line: 61], [{:value, [line: 61], nil}, {:keys, [line: 61], nil}, {:as, [line: 61], nil}, {:options, [line: 61], nil}], [{{:., [line: 62], [:erlang, :orelse]}, [line: 62], [{{:., [line: 62], [:erlang, :"=:="]}, [line: 62], [{:keys, [line: 62], nil}, :atoms!]}, {{:., [line: 62], [:erlang, :"=:="]}, [line: 62], [{:keys, [line: 62], nil}, :atoms]}]}], {:do_transform_struct, [line: 66], [{{:., [line: 65], [:maps, :merge]}, [line: 65], [{{:., [line: 64], [Map, :from_struct]}, [line: 64], [{:as, [line: 63], nil}]}, {:value, [line: 65], nil}]}, {:keys, [line: 66], nil}, {:as, [line: 66], nil}, {:options, [line: 66], nil}]}}, {[line: 69], [{:value, [line: 69], nil}, {:keys, [line: 69], nil}, {:as, [line: 69], nil}, {:options, [line: 69], nil}], [], {:do_transform_struct, [line: 75], [{{:., [line: 72], [Enum, :reduce]}, [line: 72], [{{:., [line: 71], [Map, :from_struct]}, [line: 71], [{:as, [line: 70], nil}]}, {:%{}, [line: 72], []}, {:fn, [line: 72], [{:->, [line: 72], [[{{:key, [line: 72], nil}, {:default, [line: 72], nil}}, {:acc, [line: 72], nil}], {{:., [line: 73], [:maps, :put]}, [line: 73], [{:key, [line: 73], nil}, {{:., [line: 73], [Map, :get]}, [line: 73], [{:value, [line: 73], nil}, {{:., [line: 73], [:erlang, :atom_to_binary]}, [line: 73], [{:key, [line: 73], nil}, :utf8]}, {:default, [line: 73], nil}]}, {:acc, [line: 73], nil}]}]}]}]}, {:keys, [line: 75], nil}, {:as, [line: 75], nil}, {:options, [line: 75], nil}]}}]}, {{:transformmap, 4}, :defp, [line: 49], [{[line: 49], [{:value, [line: 49], nil}, {:keys, [line: 49], nil}, {:as, [line: 49], nil}, {:options, [line: 49], nil}], [], {{:., [line: 50], [Enum, :reduce]}, [line: 50], [{:as, [line: 50], nil}, {:value, [line: 50], nil}, {:fn, [line: 50], [{:->, [line: 50], [[{{:key, [line: 50], nil}, {:as, [line: 50], nil}}, {:acc, [line: 50], nil}], {:case, [line: 51], [{{:., [line: 51], [Map, :get]}, [line: 51], [{:acc, [line: 51], nil}, {:key, [line: 51], nil}]}, [do: [{:->, [line: 52], [[{:when, [line: 52], [{:value, [line: 52], nil}, {{:., [line: 52], [...]}, [line: 52], [{...}, ...]}]}], {{:., [line: 53], [:maps, :put]}, [line: 53], [{:key, [line: 53], nil}, {:transform, [line: 53], [{...}, ...]}, {:acc, [line: 53], nil}]}]}, {:->, [line: 55], [[{:, [line: 55], nil}], {:acc, [line: 56], nil}]}]]]}]}]}]}}]}, {{:transform, 4}, :defp, [line: 31], [{[line: 31], [nil, {:_keys, [line: 31], nil}, {:_as, [line: 31], nil}, {:options, [line: 31], nil}], [], nil}, {[line: 33], [{:value, [line: 33], nil}, {:keys, [line: 33], nil}, {:=, [line: 33], [{:%{}, [line: 33], [struct: {:, [line: 33], nil}]}, {:as, [line: 33], nil}]}, {:options, [line: 33], nil}], [], {:transform_struct, [line: 34], [{:value, [line: 34], nil}, {:keys, [line: 34], nil}, {:as, [line: 34], nil}, {:options, [line: 34], nil}]}}, {[line: 37], [{:value, [line: 37], nil}, {:keys, [line: 37], nil}, {:as, [line: 37], nil}, {:options, [line: 37], nil}], [{{:., [], [:erlang, :is_map]}, [line: 37], [{:as, [line: 37], nil}]}], {:transform_map, [line: 38], [{:value, [line: 38], nil}, {:keys, [line: 38], nil}, {:as, [line: 38], nil}, {:options, [line: 38], nil}]}}, {[line: 41], [{:value, [line: 41], nil}, {:keys, [line: 41], nil}, [{:as, [line: 41], nil}], {:options, [line: 41], nil}], [], {:for, [line: 42], [{:<-, [line: 42], [{:v, [line: 42], nil}, {:value, [line: 42], nil}]}, [do: {:transform, [line: 42], [{:v, [line: 42], nil}, {:keys, [line: 42], nil}, {:as, [line: 42], nil}, {:options, [line: 42], nil}]}]]}}, {[line: 45], [{:value, [line: 45], nil}, {:_keys, [line: 45], nil}, {:_as, [line: 45], nil}, {:_options, [line: 45], nil}], [], {:value, [line: 46], nil}}]}, {{:transform, 2}, :def, [line: 20], [{[line: 20], [{:value, [line: 20], nil}, {:options, [line: 20], nil}], [{{:., [line: 20], [:erlang, :orelse]}, [line: 20], [{{:., [], [:erlang, :is_map]}, [line: 20], [{:value, [line: 20], nil}]}, {{:., [], [:erlang, :is_list]}, [line: 20], [{:value, [line: 20], nil}]}]}], {:case, [line: 21], [{{:., [line: 21], [Map, :get]}, [line: 21], [{:options, [line: 21], nil}, :as]}, [do: [{:->, [line: 22], [[nil], {:value, [line: 22], nil}]}, {:->, [line: 23], [[{:as, [line: 23], nil}], {:transform, [line: 23], [{:value, [line: 23], nil}, {{:., [line: 23], [Map, :get]}, [line: 23], [{:options, [line: 23], nil}, :keys]}, {:as, [line: 23], nil}, {:options, [line: 23], nil}]}]}]]]}}, {[line: 27], [{:value, [line: 27], nil}, {:_options, [line: 27], nil}], [], {:value, [line: 28], nil}}]}, {{:do_transform_struct, 4}, :defp, [line: 78], [{[line: 78], [{:value, [line: 78], nil}, {:keys, [line: 78], nil}, {:as, [line: 78], nil}, {:options, [line: 78], nil}], [], {:block, [], [{:=, [line: 79], [{:default, [line: 79], nil}, {{:., [], [Kernel, :struct]}, [line: 79], [{{:., [line: 79], [{:as, [line: 79], nil}, :struct]}, [line: 79], []}]}]}, {{:., [line: 102], [Poison.Decoder, :decode]}, [line: 102], [{{:., [line: 101], [:maps, :put]}, [line: 101], [:struct, {{:., [line: 101], [{:as, [line: 101], nil}, :struct]}, [line: 101], []}, {{:., [line: 83], [Enum, :reduce]}, [line: 83], [{{:., [line: 82], [Map, :from_struct]}, [line: 82], [{:as, [line: 81], nil}]}, {:%{}, [line: 83], []}, {:fn, [line: 83], [{:->, [line: 83], [[{{:key, [...], ...}, {:as, ...}}, {:acc, [...], ...}], {:block, [line: 102], [...]}]}]}]}]}, {:options, [line: 102], nil}]}]}}]}], deprecated: [], file: "/Users/attilagal/Projects/digipolis/focus/squad-service/deps/poison/lib/poison/decoder.ex", line: 15, module: Poison.Decode, unreachable: []}) (elixir) src/elixir_erl.erl:18: :elixir_erl.debug_info/4 dialyzer_utils.erl:117: :dialyzer_utils.get_core_from_beam/2 (language_server) lib/language_server/dialyzer.ex:402: ElixirLS.LanguageServer.Dialyzer.module_md5/1 (language_server) lib/language_server/dialyzer.ex:250: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.update_stale/4 (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2 (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5 (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3 Function: &:erlang.apply/2 Args: [#Function<8.101579333/1 in ElixirLS.LanguageServer.Dialyzer.update_stale/4>, [".elixir_ls/build/test/lib/poison/ebin/Elixir.Poison.Decode.beam"]]

WilHall commented 5 years ago

I am also seeing this issue. My environment is: Elixir & Erlang versions (elixir --version): Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe], Elixir 1.9.1 (compiled with Erlang/OTP 21) Operating system: MacOS Mojave 10.14.6 Client (editor or IDE): Visual Studio Code

AttilaGal commented 5 years ago

as an update: this seemed to have been resolved by itself by updating to the most recent version of VS Code §

larskrantz commented 5 years ago

Have this problem too: VS Code v1.39.2 on macOS Mojave 10.14.6 Erlang/OTP 22 [erts-10.5.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace] Elixir 1.9.2 (compiled with Erlang/OTP 22)

ryanbillingsley commented 4 years ago

Running latest VSCode:

Version: 1.40.1 (system setup)
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362

And Elixir version:

Erlang/OTP 21 [erts-10.0.1] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.9.4 (compiled with Erlang/OTP 20)

Seeing this error constantly every time "Building core Elixir PLT..." shows up.

markevich commented 4 years ago
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!