Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show function arguments in different colors in method errors #50884

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,21 @@
if ft <: Function && isempty(ft.parameters) && _isself(ft)
f_is_function = true
end
print(io, "no method matching ")
show_signature_function(io, isa(f, Type) ? Type{f} : typeof(f))
print(io, "(")
colors = Iterators.cycle((:default, :blue))

Check warning on line 302 in base/errorshow.jl

View workflow job for this annotation

GitHub Actions / Check whitespace

Whitespace check

trailing whitespace
for (i, (typ, color)) in enumerate(zip(arg_types_param, colors))
printstyled(io, "::", typ; color)
i == length(arg_types_param) || print(io, ", ")
end
if !isempty(kwargs)
print(io, "; ")
for (i, (k, v)) in enumerate(kwargs)
print(io, k, "::", typeof(v))
i == length(kwargs)::Int || print(io, ", ")
end
end
if is_arg_types
print(io, "no method matching invoke ")
else
Expand Down
Loading