Skip to content

Commit f9f265d

Browse files
committed
use JsonRpc for logs
1 parent d5560e7 commit f9f265d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

apps/language_server/lib/language_server/providers/formatting.ex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
2323
]
2424

2525
import ElixirLS.LanguageServer.Protocol, only: [range: 4]
26+
alias ElixirLS.LanguageServer.JsonRpc
2627
alias ElixirLS.LanguageServer.SourceFile
2728

2829
def build_cache(root_uri) do
@@ -159,22 +160,20 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
159160

160161
case opts_result do
161162
{:ok, opts} ->
162-
IO.puts("[ElixirLS FormattingCache] Formatter building cache")
163+
JsonRpc.log_message(:info, "[ElixirLS Formatting] Building cache...")
163164
populate_cache(dir, state.format_table, opts)
164-
IO.puts("[ElixirLS FormattingCache] Formatter cache built")
165+
JsonRpc.log_message(:info, "[ElixirLS Formatting] Cache built.")
165166

166167
:error ->
167-
IO.puts(
168-
"[ElixirLS FormattingCache] Formatter cache will not be built: unable to handle formatter opts"
168+
JsonRpc.log_message(:info,
169+
"[ElixirLS Formatting] Cache will not be built: unable to handle formatter opts"
169170
)
170171
end
171172

172173
{:reply, :ok, %{state | project_dir: dir, formatter_opts: opts_result}}
173174
end
174175

175176
defp populate_cache(project_dir, ets, opts) do
176-
IO.puts("formatting cache with #{inspect(opts)}")
177-
178177
if inputs = opts[:inputs] do
179178
inputs
180179
|> Stream.flat_map(fn glob ->

0 commit comments

Comments
 (0)