Skip to content

Commit

Permalink
edlin_expand: Exclude zero-arity functions when a nesting exists
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Apr 12, 2024
1 parent af3d796 commit fb4e417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/stdlib/src/edlin_expand.erl
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,12 @@ expand_function_parameter_type(Mod, MFA, FunType, Args, Unfinished, Nestings, FT
end,
case match_arguments(TypeTree, Args) of
false -> {no, [], []};
true when Parameters == [] -> {yes, ")", [#{title=>MFA, elems=>[{")",[]}], options=>[]}]};
true when Parameters == [] ->
if Nestings == [] ->
{yes, ")", [#{title=>MFA, elems=>[{")",[]}], options=>[]}]};
true ->
{no, [], []}
end;
true ->
Parameter = lists:nth(length(Args)+1, Parameters),
{T, _Name} = case Parameter of
Expand Down
1 change: 1 addition & 0 deletions lib/stdlib/test/edlin_expand_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ function_parameter_completion(Config) ->
options:=[{highlight_param,1}]}],
options:=[highlight_all]}]} = do_expand("complete_function_parameter:multi_arity_fun("),
{no, [], [#{elems:=[#{elems:=[#{elems:=[{"true",[]},{"false",[]}]}]}]}]} = do_expand("complete_function_parameter:multi_arity_fun(1,"),
{no, [], []} = do_expand("complete_function_parameter:multi_arity_fun(["),
{no,[],
[#{elems :=
[#{elems :=
Expand Down

0 comments on commit fb4e417

Please sign in to comment.