Skip to content

Commit

Permalink
enable ANSI colors in debug adapter
Browse files Browse the repository at this point in the history
the output looks correctly in recent VSCode
Fixes elixir-lsp/vscode-elixir-ls#422
  • Loading branch information
lukaszsamson committed Jun 23, 2024
1 parent 9cd1937 commit 0b9fec1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions apps/debug_adapter/lib/debug_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule ElixirLS.DebugAdapter do
Application.load(:erts)
Application.put_env(:elixir, :ansi_enabled, false)
WireProtocol.intercept_output(&Output.debuggee_out/1, &Output.debuggee_err/1)
Application.put_env(:elixir, :ansi_enabled, true)
Launch.start_mix()

if Version.match?(System.version(), ">= 1.15.0-dev") do
Expand Down
3 changes: 0 additions & 3 deletions apps/debug_adapter/lib/debug_adapter/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1730,9 +1730,6 @@ defmodule ElixirLS.DebugAdapter.Server do
Mix.Task.run("loadconfig")
end

# make sure ANSI is disabled
Application.put_env(:elixir, :ansi_enabled, false)

unless "--no-compile" in task_args or "--no-mix-exs" in task_args do
case Mix.Task.run("compile", ["--ignore-module-conflict", "--return-errors"]) do
{:error, diagnostics} ->
Expand Down

0 comments on commit 0b9fec1

Please sign in to comment.