@@ -128,13 +128,6 @@ defmodule ElixirLS.Utils.CompletionEngine do
128
128
end
129
129
130
130
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
-
138
131
case NormalizedCode.Fragment . cursor_context ( code ) do
139
132
{ :alias , hint } when is_list ( hint ) ->
140
133
expand_aliases ( List . to_string ( hint ) , env , metadata , cursor_position , false , opts )
@@ -153,7 +146,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
153
146
env ,
154
147
metadata ,
155
148
cursor_position ,
156
- only_structs ,
149
+ false ,
157
150
opts
158
151
)
159
152
@@ -165,7 +158,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
165
158
env ,
166
159
metadata ,
167
160
cursor_position ,
168
- only_structs ,
161
+ false ,
169
162
opts
170
163
)
171
164
@@ -202,33 +195,27 @@ defmodule ElixirLS.Utils.CompletionEngine do
202
195
# to provide signatures and falls back to expand_local_or_var
203
196
expand_expr ( env , metadata , cursor_position , opts )
204
197
205
- # elixir >= 1.13
206
198
{ :operator , operator } ->
207
199
case operator do
208
200
[ ?^ ] -> expand_var ( "" , env , metadata )
209
201
[ ?& ] -> expand_expr ( env , metadata , cursor_position , opts )
210
202
_ -> expand_local ( List . to_string ( operator ) , false , env , metadata , cursor_position )
211
203
end
212
204
213
- # elixir >= 1.13
214
205
{ :operator_arity , operator } ->
215
206
expand_local ( List . to_string ( operator ) , true , env , metadata , cursor_position )
216
207
217
- # elixir >= 1.13
218
208
{ :operator_call , _operator } ->
219
209
expand_local_or_var ( "" , env , metadata , cursor_position )
220
210
221
- # elixir >= 1.13
222
211
{ :sigil , [ ] } ->
223
212
expand_sigil ( env , metadata , cursor_position )
224
213
225
- # elixir >= 1.13
226
214
{ :sigil , [ _ ] } ->
227
215
# {:yes, [], ~w|" """ ' ''' \( / < [ { \||c}
228
216
# we choose to not provide sigil chars
229
217
no ( )
230
218
231
- # elixir >= 1.13
232
219
{ :struct , struct } when is_list ( struct ) ->
233
220
expand_aliases ( List . to_string ( struct ) , env , metadata , cursor_position , true , opts )
234
221
@@ -970,7 +957,7 @@ defmodule ElixirLS.Utils.CompletionEngine do
970
957
end
971
958
972
959
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
974
961
modules = Enum . map ( :code . all_loaded ( ) , & Atom . to_string ( elem ( & 1 , 0 ) ) )
975
962
976
963
# TODO it seems we only run in interactive mode - remove the check?
0 commit comments