Skip to content

Commit 292f379

Browse files
committed
fix build and tests on OTP 28
1 parent 0da5005 commit 292f379

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ defmodule ElixirSense.MixProject do
4242
[
4343
{:excoveralls, "~> 0.17", only: :test},
4444
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
45-
{:credo, "~> 1.0", only: [:dev], runtime: false},
45+
# TODO: Uncomment this when we have a credo version that supports OTP 28
46+
# {:credo, "~> 1.0", only: [:dev], runtime: false},
4647
{:ex_doc, "~> 0.18", only: [:dev], runtime: false}
4748
]
4849
end

test/elixir_sense/core/metadata_builder_test.exs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,11 +2361,19 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23612361
%VarInfo{name: :var2, type: {:struct, _, {:atom, Time}, nil}},
23622362
%VarInfo{name: :var3, type: {:struct, _, {:atom, DateTime}, nil}},
23632363
%VarInfo{name: :var4, type: {:struct, _, {:atom, NaiveDateTime}, nil}},
2364-
%VarInfo{name: :var5, type: {:struct, _, {:atom, Regex}, nil}},
2365-
%VarInfo{name: :var6, type: {:struct, _, {:atom, Regex}, nil}},
2364+
%VarInfo{name: :var5, type: regex_type_1},
2365+
%VarInfo{name: :var6, type: regex_type_2},
23662366
%VarInfo{name: :var7, type: {:struct, _, {:atom, Range}, nil}},
23672367
%VarInfo{name: :var8, type: {:struct, _, {:atom, Range}, nil}}
23682368
] = state |> get_line_vars(11)
2369+
2370+
if Version.match?(System.version(), "< 1.18.4") do
2371+
assert {:struct, _, {:atom, Regex}, nil} = regex_type_1
2372+
assert {:struct, _, {:atom, Regex}, nil} = regex_type_2
2373+
else
2374+
assert {:call, {:atom, Regex}, :compile!, [nil, nil]} = regex_type_1
2375+
assert {:call, {:atom, Regex}, :compile!, [nil, nil]} = regex_type_2
2376+
end
23692377
end
23702378

23712379
test "struct binding understands stepped ranges" do

0 commit comments

Comments
 (0)