Skip to content

Commit 691240e

Browse files
committed
remove 1.12 code
1 parent f43aa88 commit 691240e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

apps/elixir_ls_utils/lib/completion_engine.ex

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,6 @@ defmodule ElixirLS.Utils.CompletionEngine do
128128
end
129129

130130
def do_expand(code, %State.Env{} = env, %Metadata{} = metadata, cursor_position, opts \\ []) do
131-
# TODO remove when we require elixir 1.13
132-
only_structs =
133-
case code do
134-
[?% | _] -> true
135-
_ -> false
136-
end
137-
138131
case NormalizedCode.Fragment.cursor_context(code) do
139132
{:alias, hint} when is_list(hint) ->
140133
expand_aliases(List.to_string(hint), env, metadata, cursor_position, false, opts)
@@ -153,7 +146,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
153146
env,
154147
metadata,
155148
cursor_position,
156-
only_structs,
149+
false,
157150
opts
158151
)
159152

@@ -165,7 +158,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
165158
env,
166159
metadata,
167160
cursor_position,
168-
only_structs,
161+
false,
169162
opts
170163
)
171164

@@ -202,33 +195,27 @@ defmodule ElixirLS.Utils.CompletionEngine do
202195
# to provide signatures and falls back to expand_local_or_var
203196
expand_expr(env, metadata, cursor_position, opts)
204197

205-
# elixir >= 1.13
206198
{:operator, operator} ->
207199
case operator do
208200
[?^] -> expand_var("", env, metadata)
209201
[?&] -> expand_expr(env, metadata, cursor_position, opts)
210202
_ -> expand_local(List.to_string(operator), false, env, metadata, cursor_position)
211203
end
212204

213-
# elixir >= 1.13
214205
{:operator_arity, operator} ->
215206
expand_local(List.to_string(operator), true, env, metadata, cursor_position)
216207

217-
# elixir >= 1.13
218208
{:operator_call, _operator} ->
219209
expand_local_or_var("", env, metadata, cursor_position)
220210

221-
# elixir >= 1.13
222211
{:sigil, []} ->
223212
expand_sigil(env, metadata, cursor_position)
224213

225-
# elixir >= 1.13
226214
{:sigil, [_]} ->
227215
# {:yes, [], ~w|" """ ' ''' \( / < [ { \||c}
228216
# we choose to not provide sigil chars
229217
no()
230218

231-
# elixir >= 1.13
232219
{:struct, struct} when is_list(struct) ->
233220
expand_aliases(List.to_string(struct), env, metadata, cursor_position, true, opts)
234221

@@ -970,7 +957,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
970957
end
971958

972959
defp get_modules(false, %State.Env{} = env, %Metadata{} = metadata) do
973-
# TODO consider changing this to :code.all_available when otp 23 is required
960+
# TODO consider changing this to :code.all_available when otp 23 (and elixir 1.14) is required
974961
modules = Enum.map(:code.all_loaded(), &Atom.to_string(elem(&1, 0)))
975962

976963
# TODO it seems we only run in interactive mode - remove the check?

0 commit comments

Comments
 (0)