Skip to content

Commit 9288837

Browse files
authored
Merge pull request #1205 from elixir-lsp/codex/replace-inspect/1-with-to_string/1
Fix version string quoting
2 parents b326114 + 5c21e32 commit 9288837

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

apps/elixir_ls_utils/lib/launch.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ defmodule ElixirLS.Utils.Launch do
3636

3737
def get_versions do
3838
%{
39-
current_elixir_version: inspect(System.build_info()[:build]),
40-
current_otp_version: inspect(System.otp_release()),
41-
compile_elixir_version: inspect(@compiled_elixir_version),
42-
compile_otp_version: inspect(@compiled_otp_version)
39+
current_elixir_version: to_string(System.build_info()[:build]),
40+
current_otp_version: to_string(System.otp_release()),
41+
compile_elixir_version: to_string(@compiled_elixir_version),
42+
compile_otp_version: to_string(@compiled_otp_version)
4343
}
4444
end
4545

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule ElixirLS.Utils.LaunchTest do
2+
use ExUnit.Case, async: true
3+
4+
test "get_versions returns plain strings" do
5+
versions = ElixirLS.Utils.Launch.get_versions()
6+
7+
assert is_binary(versions.current_elixir_version)
8+
assert is_binary(versions.current_otp_version)
9+
assert is_binary(versions.compile_elixir_version)
10+
assert is_binary(versions.compile_otp_version)
11+
12+
for value <- Map.values(versions) do
13+
refute String.starts_with?(value, "\"")
14+
refute String.ends_with?(value, "\"")
15+
end
16+
end
17+
end

0 commit comments

Comments
 (0)