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
843 stars 52 forks source link

Formatter: Unknown dependency ... in the formatter configuration #191

Closed djthread closed 4 years ago

djthread commented 4 years ago

Environment

Issue

I seem to be having some trouble running the formatter, whether from the command palette or via alt+shift+f.

It works if I use it on a file generated with mix new foo, but if I try on a file generated with mix phx.new foo, nothing happens except I get this error in the ElixirLS output:

18:09:27.999 [error] Process #PID<0.111.0> raised an exception
** (Mix.Error) Unknown dependency :ecto_sql given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs for environment :test
    (mix) lib/mix.ex:389: Mix.raise/1
    (mix) lib/mix/tasks/format.ex:246: anonymous fn/3 in Mix.Tasks.Format.eval_deps_opts/2
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix) lib/mix/tasks/format.ex:245: Mix.Tasks.Format.eval_deps_opts/2
    (mix) lib/mix/tasks/format.ex:201: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix) lib/mix/tasks/format.ex:276: anonymous fn/2 in Mix.Tasks.Format.eval_subs_opts/3
    (elixir) lib/enum.ex:1087: anonymous fn/3 in Enum.flat_map_reduce/3
    (elixir) lib/enum.ex:3325: Enumerable.List.reduce/3

I've got no other apparent feedback. Also, it's interesting that I don't seem to get the .elixir_ls directory created in my project root.

What else might I check on? Any suggestions welcome!

Related Issue, Maybe

https://github.com/elixir-editors/emacs-elixir/issues/415

andersonmcook commented 4 years ago
Screen Shot 2019-10-03 at 12 07 45 PM

what's your ElixirLS config look like? this is mine

andersonmcook commented 4 years ago
Screen Shot 2019-10-03 at 12 10 05 PM

i also have this, whatever it may be

djthread commented 4 years ago

Hallelujah!

I wouldn't have thought since it seems to refer to behavior "on save", but checking this option

  1. Got me my .elixir_ls directory
  2. Made VSCode's formatter feature work

Thank you, @andersonmcook !

Elixir LS: Dialyzer Enabled
Run ElixirLS's rapid Dialyzer when code is saved