Skip to content

Commit 983ee5c

Browse files
authored
Make autocomplete work after pin and negation operators (#10207)
1 parent 2b6d3f8 commit 983ee5c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/iex/lib/iex/autocomplete.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ defmodule IEx.Autocomplete do
181181
|> Enum.reverse()
182182
|> trim_leading(?&)
183183
|> trim_leading(?%)
184+
|> trim_leading(?!)
185+
|> trim_leading(?^)
184186
end
185187

186188
defp trim_leading([char | rest], char), do: rest

lib/iex/test/iex/autocomplete_test.exs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,15 @@ defmodule IEx.AutocompleteTest do
312312
assert expand('f = &Enum.a') == {:yes, [], functions_list}
313313
end
314314

315+
test "negation operator completion" do
316+
assert expand('!is_bin') == {:yes, 'ary', []}
317+
end
318+
319+
test "pin operator completion" do
320+
eval("my_variable = 2")
321+
assert expand('^my_va') == {:yes, 'riable', []}
322+
end
323+
315324
defmodule SublevelTest.LevelA.LevelB do
316325
end
317326

0 commit comments

Comments
 (0)