Skip to content

Commit 39f673f

Browse files
committed
special show for AbstractVector{Method} for ::MIMEtext/plain
which is currently done for text/html this enables the jump-to-method thingy from JuliaLang#22007 to be used with methodswith(Foo) also This also prevents large spacing in the printing, since the general vector output prints with equal spacing for all elements, and some methods have very long signatures
1 parent 9e3318c commit 39f673f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

base/methodshow.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,15 @@ end
289289

290290
show(io::IO, mime::MIME"text/html", mt::MethodTable) = show(io, mime, MethodList(mt))
291291

292-
# pretty-printing of Vector{Method} for output of methodswith:
292+
# pretty-printing of AbstractVector{Method} for output of methodswith:
293+
function show(io::IO, mime::MIME"text/plain", mt::AbstractVector{Method})
294+
for (i, m) in enumerate(mt)
295+
print(io, "[$(i)] ")
296+
show(io, m)
297+
println(io)
298+
push!(LAST_SHOWN_LINE_INFOS, (string(m.file), m.line))
299+
end
300+
end
293301

294302
function show(io::IO, mime::MIME"text/html", mt::AbstractVector{Method})
295303
print(io, summary(mt))

0 commit comments

Comments
 (0)