Skip to content

Commit e5306ed

Browse files
committed
use JsonRpc for logs
1 parent 1cedfa6 commit e5306ed

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
@@ -167,22 +168,20 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
167168

168169
case opts_result do
169170
{:ok, opts} ->
170-
IO.puts("[ElixirLS FormattingCache] Formatter building cache")
171+
JsonRpc.log_message(:info, "[ElixirLS Formatting] Building cache...")
171172
populate_cache(dir, state.format_table, opts)
172-
IO.puts("[ElixirLS FormattingCache] Formatter cache built")
173+
JsonRpc.log_message(:info, "[ElixirLS Formatting] Cache built.")
173174

174175
:error ->
175-
IO.puts(
176-
"[ElixirLS FormattingCache] Formatter cache will not be built: unable to handle formatter opts"
176+
JsonRpc.log_message(:info,
177+
"[ElixirLS Formatting] Cache will not be built: unable to handle formatter opts"
177178
)
178179
end
179180

180181
{:reply, :ok, %{state | project_dir: dir, formatter_opts: opts_result}}
181182
end
182183

183184
defp populate_cache(project_dir, ets, opts) do
184-
IO.puts("formatting cache with #{inspect(opts)}")
185-
186185
if inputs = opts[:inputs] do
187186
inputs
188187
|> Stream.flat_map(fn glob ->

0 commit comments

Comments
 (0)