Skip to content

Commit f2b6172

Browse files
committed
hack for < 1.15
1 parent ef46958 commit f2b6172

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/elixir_sense/core/metadata.ex

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,24 @@ defmodule ElixirSense.Core.Metadata do
6767
}
6868
end
6969

70+
def get_cursor_env(
71+
metadata,
72+
position,
73+
surround \\ nil
74+
)
75+
76+
if Version.match?(System.version(), "< 1.15.0") do
77+
# return early if cursor env already found by parser replacing line
78+
# this helps on < 1.15 and braks tests on later versions
79+
def get_cursor_env(%__MODULE__{cursor_env: {_, env}}, _position, _surround) do
80+
env
81+
end
82+
end
83+
7084
def get_cursor_env(
7185
%__MODULE__{} = metadata,
7286
{line, column},
73-
surround \\ nil
87+
surround
7488
) do
7589
{prefix, source_with_cursor} =
7690
case surround do

0 commit comments

Comments
 (0)