-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add colour to show(::Method) #40916
Add colour to show(::Method) #40916
Conversation
printstyled(io, "::", d[2]; color=:yellow) | ||
else | ||
printstyled(io, "::", typespec[1]; color=:yellow) | ||
printstyled(io, "{", typespec[2]; color=247) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that in general we try to only use the 16 standard colors in the REPL since they are the ones most widely supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else I'd think is worth considering, but maybe outside of this PR: terminal hyperlinks to the referenced files. printf '\e]8;;file:///usr/share/julia/stdlib/v1.6/SparseArrays/src/sparsevector.jl\e\\\e[32msparsevector.jl\e]8;;\e\\\n' |
Ideally this should share code with stacktrace printing. |
I'm guessing this is the sort of thing you're thinking of? This would require some sort of in-built syntax highlighting, and if Julia were to go that route, would it be best to include https://github.com/KristofferC/OhMyREPL.jl ? This is now both a bit off-topic and speculative but given how much nicer it makes the REPL experience (to me at least) I'd think it would be a nice thing for all users to have, and I'd imagine it would provide primatives that would make doing the sort of highlighting above really easy. I'm going a bit out a limb though, @KristofferC might have something to add on this. |
Add color to show(io, Method) with printstyled, and also modify the header displayed when representing a list of methods to emphasise the number and function name.
Clearly, #40251 is preferred at this point. |
This is a follow-up from #40913. First PR / interaction here, so please let me know if there's anything like a commit message guideline etc. I've missed 🙂.
Simply put, I think adding colour to
show(::Method)
makes it easier to find information at a glance.The original spiel