Skip to content

Commit b6c74aa

Browse files
committed
uncomment test for case working on 1.18
1 parent 85aad1b commit b6c74aa

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

apps/language_server/test/providers/definition/locator_test.exs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,29 +1132,30 @@ defmodule ElixirLS.LanguageServer.Providers.Definition.LocatorTest do
11321132
}
11331133
end
11341134

1135-
# TODO not supported in Code.Fragment.surround_context as of elixir 1.17
1136-
# test "find definition of &1 capture variable" do
1137-
# buffer = """
1138-
# defmodule MyModule do
1139-
# def go() do
1140-
# abc = 5
1141-
# & [
1142-
# &1,
1143-
# abc,
1144-
# cde = 1,
1145-
# record_env()
1146-
# ]
1147-
# end
1148-
# end
1149-
# """
1150-
1151-
# assert Locator.definition(buffer, 4, 8) == %Location{
1152-
# type: :variable,
1153-
# file: nil,
1154-
# line: 4,
1155-
# column: 7
1156-
# }
1157-
# end
1135+
if Version.match?(System.version(), ">= 1.18.0") do
1136+
test "find definition of &1 capture variable" do
1137+
buffer = """
1138+
defmodule MyModule do
1139+
def go() do
1140+
abc = 5
1141+
& [
1142+
&1,
1143+
abc,
1144+
cde = 1,
1145+
record_env()
1146+
]
1147+
end
1148+
end
1149+
"""
1150+
1151+
assert %Location{
1152+
type: :variable,
1153+
file: nil,
1154+
line: 5,
1155+
column: 7
1156+
} = Locator.definition(buffer, 5, 8)
1157+
end
1158+
end
11581159

11591160
test "find definition of write variable on definition" do
11601161
buffer = """

0 commit comments

Comments
 (0)