Skip to content

Commit

Permalink
run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Nov 28, 2023
1 parent 7edf428 commit 48baa6a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apps/language_server/lib/language_server/build.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ defmodule ElixirLS.LanguageServer.Build do
case deps_result do
:ok ->
if Keyword.get(opts, :compile?) do
{status, compile_diagnostics} = run_mix_compile(Keyword.get(opts, :force?, false))
{status, compile_diagnostics} =
run_mix_compile(Keyword.get(opts, :force?, false))

compile_diagnostics =
Diagnostics.normalize(compile_diagnostics, root_path, mixfile)
Expand Down Expand Up @@ -128,7 +129,6 @@ defmodule ElixirLS.LanguageServer.Build do
JsonRpc.telemetry("build", %{"elixir_ls.build_result" => result}, %{
"elixir_ls.build_time" => div(us, 1000)
})
IO.warn("Releasing build lock")
end)
end)

Expand Down Expand Up @@ -266,7 +266,6 @@ defmodule ElixirLS.LanguageServer.Build do
Code.put_compiler_option(:no_warn_undefined, :all)

# We can get diagnostics if Mixfile fails to load
IO.warn("Building mixfile #{mixfile}")
{mixfile_status, mixfile_diagnostics} =
case Kernel.ParallelCompiler.compile([mixfile]) do
{:ok, _, warnings} ->
Expand Down
5 changes: 3 additions & 2 deletions apps/language_server/lib/language_server/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ defmodule ElixirLS.LanguageServer.Server do
%__MODULE__{build_ref: ref, build_running?: true} = state
) do
state = %{state | build_running?: false}
IO.warn("Build end reason: #{inspect(reason)}")

# in case the build was interrupted make sure that cwd is reset to project dir
case File.cd(state.project_dir) do
Expand Down Expand Up @@ -1339,7 +1338,9 @@ defmodule ElixirLS.LanguageServer.Server do

# Build

defp trigger_build(state = %__MODULE__{project_dir: project_dir, full_build_done?: full_build_done?}) do
defp trigger_build(
state = %__MODULE__{project_dir: project_dir, full_build_done?: full_build_done?}
) do
cond do
not is_binary(project_dir) ->
state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,8 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbolsTest do
end
"""

assert {:error, :server_error, "Cannot parse source file", false} = DocumentSymbols.symbols(uri, text, true)
assert {:error, :server_error, "Cannot parse source file", false} =
DocumentSymbols.symbols(uri, text, true)
end

test "returns def and defp as a prefix" do
Expand Down
4 changes: 3 additions & 1 deletion apps/language_server/test/server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,9 @@ defmodule ElixirLS.LanguageServer.ServerTest do
"uri" => ^error_file,
"diagnostics" => [
%{
"message" => "** (CompileError) lib/has_error.ex:4: undefined function does_not_exist" <> _,
"message" =>
"** (CompileError) lib/has_error.ex:4: undefined function does_not_exist" <>
_,
"range" => %{"end" => %{"line" => 3}, "start" => %{"line" => 3}},
"severity" => 1
}
Expand Down

0 comments on commit 48baa6a

Please sign in to comment.