Skip to content

Commit 4c512a2

Browse files
authored
Update minimum versions to Elixir 1.10 and OTP 22 (#561)
* Update minimum versions to Elixir 1.10 and OTP 22 Keeps them in line with our Version Support Guidance: https://github.com/elixir-lsp/elixir-ls/blob/be0af9dadb2c4cceeb0893fe71d8380debe33f08/DEVELOPMENT.md#version-support-guidelines Also by moving the minimum version of Elixir to 1.10 we can finally use compilation tracers (initial PR at elixir-lsp/elixir_sense#80) * Fix formatting
1 parent f77999b commit 4c512a2

File tree

11 files changed

+46
-51
lines changed

11 files changed

+46
-51
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- elixir: 1.8.x
20-
otp: 21.3.8.20
21-
tests_may_fail: false
22-
- elixir: 1.9.x
23-
otp: 21.3.8.23
24-
tests_may_fail: false
2519
- elixir: 1.10.x
26-
otp: 21.3.8.23
20+
otp: 22.3.4.20
2721
tests_may_fail: false
2822
check_unused_deps: true
2923
- elixir: 1.11.x
30-
otp: 21.3.8.20
24+
otp: 23.3.4.4
3125
tests_may_fail: false
3226
check_unused_deps: true
3327
- elixir: 1.12.x
34-
otp: 22.3.4.19
28+
otp: 23.3.4.4
3529
tests_may_fail: false
3630
check_unused_deps: true
3731
- elixir: 1.12.x

.github/workflows/release-asset.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- elixir-version: '1.12'
35+
- elixir-version: '1.12.1'
3636
otp-version: '24.0'
3737
- elixir-version: '1.11.4'
3838
otp-version: '23.3'
3939
- elixir-version: '1.10.4'
40-
otp-version: '23.3'
41-
- elixir-version: '1.9.4'
4240
otp-version: '22.3'
43-
- elixir-version: '1.8.2'
44-
otp-version: '21.3'
4541
default: true
4642

4743
steps:

.release-tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
#
44
# The versions selected here are the versions that are used to build a binary
55
# release for distribution
6-
elixir 1.8.2-otp-21
7-
erlang 21.3.8.17
6+
elixir 1.10.4-otp-22
7+
erlang 22.3.4.20

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ For VSCode install the extension: https://marketplace.visualstudio.com/items?ite
8686

8787
Elixir:
8888

89-
- 1.8.0 minimum
89+
- 1.10.0 minimum
9090

9191
Erlang:
9292

93-
- OTP 21 minimum
93+
- OTP 22 minimum
9494

9595
Installing Elixir and Erlang from [ASDF](https://github.com/asdf-vm/asdf) is generally recommended so that you can have different projects using different versions of Elixir without having to change your system-installed version. ElixirLS will detect and use the version of Elixir and Erlang that you have configured in asdf.
9696

apps/elixir_ls_debugger/lib/debugger/cli.ex

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ defmodule ElixirLS.Debugger.CLI do
1414
WireProtocol.stream_packets(&Server.receive_packet/1)
1515
end
1616

17-
# Debugging does not work on Elixir 1.10.0-1.10.2:
18-
# https://github.com/elixir-lsp/elixir-ls/issues/158
1917
defp warn_if_unsupported_version do
20-
elixir_version = System.version()
21-
22-
unless Version.match?(elixir_version, ">= 1.8.0") do
23-
message =
24-
"WARNING: Elixir versions below 1.8 are not supported. (Currently v#{elixir_version})"
18+
with {:error, message} <- ElixirLS.Utils.MinimumVersion.check_elixir_version() do
19+
Output.print_err("WARNING: " <> message)
20+
end
2521

26-
Output.print_err(message)
22+
with {:error, message} <- ElixirLS.Utils.MinimumVersion.check_otp_version() do
23+
Output.print_err("WARNING: " <> message)
2724
end
2825

26+
# Debugging does not work on Elixir 1.10.0-1.10.2:
27+
# https://github.com/elixir-lsp/elixir-ls/issues/158
28+
elixir_version = System.version()
29+
2930
if Version.match?(elixir_version, ">= 1.10.0") && Version.match?(elixir_version, "< 1.10.3") do
3031
message =
3132
"WARNING: Debugging is not supported on Elixir #{elixir_version}. Please upgrade" <>
@@ -34,14 +35,5 @@ defmodule ElixirLS.Debugger.CLI do
3435

3536
Output.print_err(message)
3637
end
37-
38-
otp_release = String.to_integer(System.otp_release())
39-
40-
if otp_release < 21 do
41-
message =
42-
"WARNING: Erlang OTP releases below 21 are not supported (Currently OTP #{otp_release})"
43-
44-
Output.print_err(message)
45-
end
4638
end
4739
end

apps/elixir_ls_debugger/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule ElixirLS.Debugger.Mixfile do
99
config_path: "../../config/config.exs",
1010
deps_path: "../../deps",
1111
lockfile: "../../mix.lock",
12-
elixir: ">= 1.8.0",
12+
elixir: ">= 1.10.0",
1313
build_embedded: false,
1414
start_permanent: true,
1515
build_per_environment: false,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
defmodule ElixirLS.Utils.MinimumVersion do
2+
def check_otp_version do
3+
otp_release = String.to_integer(System.otp_release())
4+
5+
if otp_release < 22 do
6+
{:error,
7+
"Erlang OTP releases below 22 are not supported (Currently running OTP #{otp_release})"}
8+
else
9+
:ok
10+
end
11+
end
12+
13+
def check_elixir_version do
14+
if Version.match?(System.version(), ">= 1.10.0") do
15+
:ok
16+
else
17+
{:error,
18+
"Elixir versions below 1.10 are not supported. (Currently running v#{System.version()})"}
19+
end
20+
end
21+
end

apps/elixir_ls_utils/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule ElixirLS.Utils.Mixfile do
1010
deps_path: "../../deps",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
lockfile: "../../mix.lock",
13-
elixir: ">= 1.8.0",
13+
elixir: ">= 1.10.0",
1414
build_embedded: false,
1515
start_permanent: false,
1616
build_per_environment: false,

apps/language_server/lib/language_server/server.ex

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,20 +1016,12 @@ defmodule ElixirLS.LanguageServer.Server do
10161016
end
10171017

10181018
defp show_version_warnings do
1019-
unless Version.match?(System.version(), ">= 1.8.0") do
1020-
JsonRpc.show_message(
1021-
:warning,
1022-
"Elixir versions below 1.8 are not supported. (Currently v#{System.version()})"
1023-
)
1019+
with {:error, message} <- ElixirLS.Utils.MinimumVersion.check_elixir_version() do
1020+
JsonRpc.show_message(:warning, message)
10241021
end
10251022

1026-
otp_release = String.to_integer(System.otp_release())
1027-
1028-
if otp_release < 21 do
1029-
JsonRpc.show_message(
1030-
:info,
1031-
"Erlang OTP releases below 21 are not supported (Currently OTP #{otp_release})"
1032-
)
1023+
with {:error, message} <- ElixirLS.Utils.MinimumVersion.check_otp_version() do
1024+
JsonRpc.show_message(:warning, message)
10331025
end
10341026

10351027
case Dialyzer.check_support() do

apps/language_server/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule ElixirLS.LanguageServer.Mixfile do
55
[
66
app: :language_server,
77
version: "0.7.0",
8-
elixir: ">= 1.8.0",
8+
elixir: ">= 1.10.0",
99
build_path: "../../_build",
1010
config_path: "../../config/config.exs",
1111
deps_path: "../../deps",

0 commit comments

Comments
 (0)