Skip to content

Commit

Permalink
Merge branch 'frazze/stdlib/completion_of_fun_expression_crashes/OTP-…
Browse files Browse the repository at this point in the history
…19351' into maint

* frazze/stdlib/completion_of_fun_expression_crashes/OTP-19351:
  stdlib: fix bug in shell completion when completing 'fun('

OTP-19351
  • Loading branch information
frazze-jobb committed Nov 13, 2024
2 parents a965095 + 234bdd7 commit 12d2db6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/stdlib/src/edlin_context.erl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ get_context([$(|Bef], CR) ->
{Bef1, Fun} = edlin_expand:over_word(Bef),
case Fun of
[] -> {term}; % parenthesis
"fun" -> {fun_};
_ ->
{_, Mod} = over_module(Bef1, Fun),
case Mod of
Expand Down
2 changes: 2 additions & 0 deletions lib/stdlib/test/edlin_context_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,6 @@ get_context(_Config) ->
{term,[],{float,"-1.2"}} = edlin_context:get_context(lists:reverse("-1.2")),
{term,[],{tuple, "{hej, svej}"}} = edlin_context:get_context(lists:reverse("begin {hej, svej}")),
{term,[],[]} = edlin_context:get_context(lists:reverse("begin {hej, svej} = {")),
{fun_} = edlin_context:get_context(lists:reverse("fun(")),
{fun_} = edlin_context:get_context(lists:reverse("maps:map(fun(")),
ok.

0 comments on commit 12d2db6

Please sign in to comment.