diff options
author | frazze-jobb <frazze@erlang.org> | 2023-02-27 13:15:03 +0100 |
---|---|---|
committer | frazze-jobb <frazze@erlang.org> | 2023-02-27 15:20:17 +0100 |
commit | 99c1493bb8aebc5b7c28fb63651dc9c4201aa102 (patch) | |
tree | da9f8caa9314279724b6b974cb1da723b375a8cb /lib/stdlib | |
parent | bdc34f03eed61129efba3e2792e0f5e71b4545f1 (diff) | |
download | erlang-99c1493bb8aebc5b7c28fb63651dc9c4201aa102.tar.gz |
Fixes bug in shell completion
previously multi arity functions with a zero arity variant
omitted the zero arity function.
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/edlin_expand.erl | 2 | ||||
-rw-r--r-- | lib/stdlib/test/edlin_expand_SUITE.erl | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl index 0e70868a1b..9823534e9b 100644 --- a/lib/stdlib/src/edlin_expand.erl +++ b/lib/stdlib/src/edlin_expand.erl @@ -403,7 +403,7 @@ expand_function_parameter_type(Mod, MFA, FunType, Args, Unfinished, Nestings, FT end, case match_arguments(TypeTree, Args) of false -> {no, [], []}; - true when Parameters == [] -> {yes, ")", []}; + true when Parameters == [] -> {yes, ")", [#{title=>MFA, elems=>[")"], options=>[]}]}; true -> Parameter = lists:nth(length(Args)+1, Parameters), {T, _Name} = case Parameter of diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 90a5735055..206a8b7246 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -261,7 +261,11 @@ function_parameter_completion(Config) -> elems:=[#{title:="types", elems:=[{"integer()",[]}], options:=[{hide,title}]}], - options:=[{highlight_param,1}]}], + options:=[{highlight_param,1}]}, + #{title:= + "complete_function_parameter:multi_arity_fun()", + options:=[], + elems:=[")"]}], 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,[], |