@@ -197,15 +197,16 @@ function printmethod(buffer::IOBuffer, binding::Docs.Binding, func, method::Meth
197
197
# TODO : print qualified?
198
198
print (buffer, binding. var)
199
199
print (buffer, " (" )
200
+ local args = arguments (method)
201
+ local kws = keywords (func, method)
200
202
201
203
#=
202
204
Calculate how long the string of the args and kwargs are. If too long,
203
205
break signature up into a nicely formatted multiline method signature.
204
206
=#
205
207
nl_delim, nl = get_format_delimiters (args, kws; delim= " " , break_point= 40 )
206
208
207
- join (buffer, arguments (method), " , $nl_delim " )
208
- local kws = keywords (func, method)
209
+ join (buffer, args, " , $nl_delim " )
209
210
if ! isempty (kws)
210
211
print (buffer, " ; $nl_delim " )
211
212
join (buffer, kws, " , $nl_delim " )
@@ -562,12 +563,12 @@ Format the return type to look prettier.
562
563
"""
563
564
function format_return_type_string (rt; delim = " " , break_point= 40 )
564
565
if startswith (string (rt), " Tuple{" ) && length (string (rt)) > break_point
565
- string ( # TODO Unions[...} look ugly
566
+ string (
566
567
" Tuple{\n $delim " ,
567
568
join ([string (x) for x in rt. types]," ,\n $delim " ),
568
569
" \n }" ,
569
570
)
570
- else
571
+ else # TODO Unions{...} look ugly, but represent one type, so maybe should be on one line
571
572
string (rt)
572
573
end
573
574
end
0 commit comments