-
-
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
Fine-tune stacktrace printing #37773
Conversation
show_method_params(io, tv) | ||
nothing | ||
end | ||
|
||
function print_type_stacktrace(io, type; color=:normal) | ||
str = sprint(show, type, context=io) | ||
i = findfirst('{', str) |
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.
This seems a bit crude, but I got lost trying to find the right printing function to overload for this purpose (of printing only the type parameters dimly, not the outermost type). It should still use aliases like Matrix{Int}
.
It's also possible this should be a method of print_within_stacktrace
instead of its own function.
A question raised in this Discourse thread is whether the stack trace should also truncate very long types. The example there has lines over 7000 characters long. It would be trivial to make (cc @tomerarnon) |
While I'm personally of the opinion that this should definitely happen, it wasn't clear to me that the discussion had settled on a precise course of action (and while there did seem to be some support for the idea, it was less than I expected, judging based on small numbers of likes and participants). We brought up a handful of behaviors, (i.e. opt-in/out, and/or toggleable through an |
Latest commit restores bold function names. I don't see precisely how these were disabled in #36134, so they may have been put back differently, torture tests welcomed. (I have updated the gist linked above, too.) 1.5.2, master, and this PR (with Fira Code, whose bold is pretty strong): (Merge conflict is with #37750, this line: https://github.com/JuliaLang/julia/pull/37750/files#diff-c616894fef3ba781d1e1cf77a08e69f366ffd9e5b1cfe1220e7bdae85377e0b2R2067) |
Could you perhaps rebase this on master to get a fresh CI run and get rid of the merge conflict? |
I'd like to (again) bring up that the red color for the Base module is non-ideal. I tried this out and got: and immediately my brain went, "Oh what's that error message, |
Thanks for the screenshot, maybe they are too close. (Notice also
Here's the current look, VScode's default dark theme, JuliaMono, with Base now in |
Cool, I like it much better with bold. Especially for light themes, as black is not that much more contrasting with white compared to dark gray. |
Let's try this out then :) |
Some constructors don't get printed in bold, but perhaps they should:
|
This is a small tweak to #36134, as discussed there. This gist has the same changes.