Skip to content

Commit 18aedca

Browse files
committed
correctly encode output messages as binary
Fixes elixir-lsp/vscode-elixir-ls#322 Bug introduced in #457
1 parent bf9db5a commit 18aedca

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

apps/elixir_ls_utils/lib/output_device.ex

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@ defmodule ElixirLS.Utils.OutputDevice do
22
@moduledoc """
33
Intercepts IO request messages and forwards them to the Output server to be sent as events to
44
the IDE. Implements [Erlang I/O Protocol](https://erlang.org/doc/apps/stdlib/io_protocol.html)
5-
6-
In order to send console output to Visual Studio Code, the debug adapter needs to send events
7-
using the usual wire protocol. In order to intercept the debugged code's output, we replace the
8-
registered processes `:user` and `:standard_error` and the process's group leader with instances
9-
of this server. When it receives a message containing output, it sends an event via the `Output`
10-
server with the correct category ("stdout" or "stderr").
115
"""
126

13-
@opts binary: true, encoding: :unicode
7+
@opts binary: true, encoding: :latin1
148

159
## Client API
1610

apps/elixir_ls_utils/test/output_device_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ defmodule ElixirLS.Utils.OutputDeviceTest do
284284
output_device: output_device
285285
} do
286286
send(output_device, {:io_request, self(), 123, :getopts})
287-
assert_receive({:io_reply, 123, [binary: true, encoding: :unicode]})
287+
assert_receive({:io_reply, 123, [binary: true, encoding: :latin1]})
288288
end
289289

290290
test "valid can be set", %{

0 commit comments

Comments
 (0)