Skip to content

Commit e4264da

Browse files
authored
Upgrade elixir to v1.12 (#133)
* Upgrade elixir to v1.12 * Adapt bindings normalization to changes in elixir v1.12 * Adapt suggestion test to account for new Enum function in elixir v1.12 * Allow 2 new Kernel macros in elixir v1.12 * Allow to execute stepped ranges added in elixir 1.12
1 parent 60448d2 commit e4264da

8 files changed

Lines changed: 11 additions & 14 deletions

File tree

.github/workflows/elixir.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Elixir
1313
uses: erlef/setup-beam@v1
1414
with:
15-
elixir-version: '1.11.4'
15+
elixir-version: '1.12.3'
1616
otp-version: '24.0.6'
1717
- name: Restore dependencies cache
1818
uses: actions/cache@v2

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
elixir 1.11.4-otp-24
1+
elixir 1.12.3-otp-24
22
erlang 24.0.6
33
nodejs 16.9.1

elixir_buildpack.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir_version=1.11.4
1+
elixir_version=1.12.3
22
erlang_version=24.0.6

lib/elixir_console/contextual_help.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ defmodule ElixirConsole.ContextualHelp do
9191
to_string
9292
unless
9393
update_in
94+
tap
95+
then
9496
)a
9597

9698
@doc """

lib/elixir_console/elixir_safe_parts.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ defmodule ElixirConsole.ElixirSafeParts do
150150
try
151151
with
152152
{}
153+
tap
154+
then
155+
..//
153156
)a
154157

155158
def safe_modules, do: @safe_modules

lib/elixir_console/sandbox.ex

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ defmodule ElixirConsole.Sandbox do
9494

9595
case check_execution_status(sandbox.pid, normalize_options(opts)) do
9696
{:ok, {:success, {result, bindings}}} ->
97-
bindings = normalize_bindings(bindings)
98-
{:success, {result, %{sandbox | bindings: bindings}}}
97+
{:success, {result, %{sandbox | bindings: Enum.sort(bindings)}}}
9998

10099
{:ok, {:error, result}} ->
101100
{:error, {result, sandbox}}
@@ -108,13 +107,6 @@ defmodule ElixirConsole.Sandbox do
108107
end
109108
end
110109

111-
defp normalize_bindings(bindings) do
112-
for binding <- bindings, do: normalize_single_binding(binding)
113-
end
114-
115-
defp normalize_single_binding({{name, _context}, value}), do: {name, value}
116-
defp normalize_single_binding(binding), do: binding
117-
118110
@doc """
119111
The sandbox process is exited. This function should be used when the sandbox
120112
is not longer needed so resources are properly disposed.

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule ElixirConsole.MixProject do
55
[
66
app: :elixir_console,
77
version: "0.1.0",
8-
elixir: "~> 1.11.4",
8+
elixir: "~> 1.12.3",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
1111
start_permanent: Mix.env() == :prod,

test/elixir_console/autocomplete_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule ElixirConsole.AutocompleteTest do
1212
end
1313

1414
test "returns suggestions" do
15-
assert Autocomplete.get_suggestions("Enum.co", 7, []) == ["Enum.concat", "Enum.count"]
15+
assert Autocomplete.get_suggestions("Enum.cou", 8, []) == ["Enum.count", "Enum.count_until"]
1616
end
1717

1818
test "returns suggestions when the caret is in the middle" do

0 commit comments

Comments
 (0)