Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LS Crashes when loading formatter configuration #318

Closed
lukaszsamson opened this issue Jul 14, 2020 · 0 comments · Fixed by #319
Closed

LS Crashes when loading formatter configuration #318

lukaszsamson opened this issue Jul 14, 2020 · 0 comments · Fixed by #319

Comments

@lukaszsamson
Copy link
Collaborator

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
    Elixir 1.10.4 (compiled with Erlang/OTP 22)
  • Operating system: macos
  • Editor or IDE name (e.g. Emacs/VSCode): 0.5
  • LSP Client name: vscode-elixir-ls
    When opening an umbrella apps I noticed some non deterministic crashes.
Started ElixirLS v0.5.0
Elixir version: "1.10.4 (compiled with Erlang/OTP 22)"
Erlang version: "22"
ElixirLS compiled with Elixir 1.10.4 and erlang 22
MIX_ENV: dev
MIX_TARGET: 

==> phoenix
Compiling 66 files (.ex)
Generated phoenix app

==> backoffice
Compiling 86 files (.ex)
Generated backoffice app
[Info  - 11:38:52 AM] Compile took 94721 milliseconds
[Info  - 11:38:52 AM] [ElixirLS WorkspaceSymbols] Indexing...
MIX_ENV: dev
MIX_TARGET: 


11:38:54.836 [error] GenServer ElixirLS.LanguageServer.Server terminating
** (Mix.Error) Unknown dependency :phoenix given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs for environment :dev
    (mix 1.10.4) lib/mix.ex:392: Mix.raise/1
    (mix 1.10.4) lib/mix/tasks/format.ex:246: anonymous fn/3 in Mix.Tasks.Format.eval_deps_opts/2
    (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.10.4) lib/mix/tasks/format.ex:245: Mix.Tasks.Format.eval_deps_opts/2
    (mix 1.10.4) lib/mix/tasks/format.ex:201: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix 1.10.4) lib/mix/tasks/format.ex:276: anonymous fn/2 in Mix.Tasks.Format.eval_subs_opts/3
    (elixir 1.10.4) lib/enum.ex:1094: anonymous fn/3 in Enum.flat_map_reduce/3
    (elixir 1.10.4) lib/enum.ex:3686: Enumerable.List.reduce/3

Fallback message for "go to location"
vscode 1.47
11:38:52.927 [error] GenServer ElixirLS.LanguageServer.Server terminating
** (Mix.Error) Unknown dependency :phoenix given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs for environment :dev
    (mix 1.10.4) lib/mix.ex:392: Mix.raise/1
    (mix 1.10.4) lib/mix/tasks/format.ex:246: anonymous fn/3 in Mix.Tasks.Format.eval_deps_opts/2
    (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.10.4) lib/mix/tasks/format.ex:245: Mix.Tasks.Format.eval_deps_opts/2
    (mix 1.10.4) lib/mix/tasks/format.ex:201: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix 1.10.4) lib/mix/tasks/format.ex:276: anonymous fn/2 in Mix.Tasks.Format.eval_subs_opts/3
    (elixir 1.10.4) lib/enum.ex:1094: anonymous fn/3 in Enum.flat_map_reduce/3
    (elixir 1.10.4) lib/enum.ex:3686: Enumerable.List.reduce/3
    (elixir 1.10.4) lib/enum.ex:1093: Enum.flat_map_reduce/3
    (mix 1.10.4) lib/mix/tasks/format.ex:200: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix 1.10.4) lib/mix/tasks/format.ex:160: Mix.Tasks.Format.formatter_opts_for_file/2
    (language_server 0.5.0) lib/language_server/server.ex:487: ElixirLS.LanguageServer.Server.handle_request/2
    (language_server 0.5.0) lib/language_server/server.ex:332: ElixirLS.LanguageServer.Server.handle_request_packet/3
    (language_server 0.5.0) lib/language_server/server.ex:126: ElixirLS.LanguageServer.Server.handle_cast/2
    (stdlib 3.12.1) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.12.1) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
16:09:41.897 [error] GenServer ElixirLS.LanguageServer.Server terminating
** (Mix.Error) Unknown dependency :ecto given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs for environment :dev
    (mix 1.10.4) lib/mix.ex:392: Mix.raise/1
    (mix 1.10.4) lib/mix/tasks/format.ex:246: anonymous fn/3 in Mix.Tasks.Format.eval_deps_opts/2
    (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.10.4) lib/mix/tasks/format.ex:245: Mix.Tasks.Format.eval_deps_opts/2
    (mix 1.10.4) lib/mix/tasks/format.ex:201: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix 1.10.4) lib/mix/tasks/format.ex:210: Mix.Tasks.Format.maybe_cache_in_manifest/3
    (mix 1.10.4) lib/mix/tasks/format.ex:160: Mix.Tasks.Format.formatter_opts_for_file/2
    (language_server 0.5.0) lib/language_server/server.ex:487: ElixirLS.LanguageServer.Server.handle_request/2
    (language_server 0.5.0) lib/language_server/server.ex:332: ElixirLS.LanguageServer.Server.handle_request_packet/3
    (language_server 0.5.0) lib/language_server/server.ex:126: ElixirLS.LanguageServer.Server.handle_cast/2
    (stdlib 3.12.1) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.12.1) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

:phoenix and :ecto are definitely in the deps (of all the apps in the umbrella) and the deps are fetched. It seems that there is a race condition and under some circumstances the formatter config cannot be fetched.

lukaszsamson added a commit to lukaszsamson/elixir-ls-1 that referenced this issue Jul 14, 2020
@axelson axelson changed the title LS Crashes when lading formatter configuration LS Crashes when loading formatter configuration Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant