Skip to content

Commit 128ede7

Browse files
committed
fix method error
1 parent 2088813 commit 128ede7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/utilities.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,16 @@ function printmethod(buffer::IOBuffer, binding::Docs.Binding, func, method::Meth
197197
# TODO: print qualified?
198198
print(buffer, binding.var)
199199
print(buffer, "(")
200+
local args = arguments(method)
201+
local kws = keywords(func, method)
200202

201203
#=
202204
Calculate how long the string of the args and kwargs are. If too long,
203205
break signature up into a nicely formatted multiline method signature.
204206
=#
205207
nl_delim, nl = get_format_delimiters(args, kws; delim=" ", break_point=40)
206208

207-
join(buffer, arguments(method), ", $nl_delim")
208-
local kws = keywords(func, method)
209+
join(buffer, args, ", $nl_delim")
209210
if !isempty(kws)
210211
print(buffer, "; $nl_delim")
211212
join(buffer, kws, ", $nl_delim")
@@ -562,12 +563,12 @@ Format the return type to look prettier.
562563
"""
563564
function format_return_type_string(rt; delim = " ", break_point=40)
564565
if startswith(string(rt), "Tuple{") && length(string(rt)) > break_point
565-
string( #TODO Unions[...} look ugly
566+
string(
566567
"Tuple{\n$delim",
567568
join([string(x) for x in rt.types],",\n$delim"),
568569
"\n}",
569570
)
570-
else
571+
else #TODO Unions{...} look ugly, but represent one type, so maybe should be on one line
571572
string(rt)
572573
end
573574
end

0 commit comments

Comments
 (0)