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
The `import_deps` option in .formatter.exs is ignored #114
I've created a dummy project with mix new fmt_test and added {:plug, "~> 1.0"} in mix.exs. Contents of my .formatter.exs at the root of the project:
# Used by "mix format"
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
import_deps: [:plug]
]
Contents of the lib/fmt_test.ex file:
defmodule FmtTest do
use Plug.Builder
plug :foobar
def foobar(conn, _opts) do
conn
end
end
When I navigate to the project root in my shell and run mix format, it leaves the code unchanged. However, invoking the Format document command in VSCode changes the 4th line to plug(:foobar).
I think this is related to the caveat mentioned in the docs for mix format:
:import_deps (a list of dependencies as atoms) - specifies a list of dependencies whose formatter configuration will be imported. When specified, the formatter should run in the same directory as the mix.exs file that defines those dependencies. See the “Importing dependencies configuration” section below for more information.
Environment
Elixir & Erlang versions (elixir --version):
Operating system: macOS
Client (editor or IDE): VSCode 1.26.0
I've created a dummy project with
mix new fmt_test
and added{:plug, "~> 1.0"}
inmix.exs
. Contents of my.formatter.exs
at the root of the project:Contents of the
lib/fmt_test.ex
file:When I navigate to the project root in my shell and run
mix format
, it leaves the code unchanged. However, invoking theFormat document
command in VSCode changes the 4th line toplug(:foobar)
.I think this is related to the caveat mentioned in the docs for mix format: