-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
show multiple docstrings in REPL more clearly #25651
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
Conversation
89853aa
to
d789a0b
Compare
Maybe a horizontal line between them would make more sense? |
Alright, I change to that. But then I am not changing again! ;) |
d789a0b
to
e662e47
Compare
this is done by printing a horizontal line after each separate docstring
e662e47
to
fc4afdd
Compare
I think we had suggested adding just a very short (2-3 chars) horizontal line in another issue. Have you tried that? |
I tried it but didn't really like it. Too short and it is not visible enough and when you increase the length it looks odd that it just stops in the middle. I think the current version is pretty ok. |
How about bracketed lines like our logging messages? |
I think a horizontal rule is the natural thing here. We probably wouldn't add a bracket or vertical line for a single doc string, and it's a bit odd for them to suddenly appear when there are multiple doc strings. With log messages there is usually other surrounding output to distinguish them from. |
Yes, I have tried a lot of versions and I like this the most. Having a long vertical line appear just because there are multiple docstrings is a bit weird. Copy pasting docstrings will also be awkward with vertical lines. I think we should try this out. |
@@ -990,8 +990,8 @@ dynamic_test.x = "test 2" | |||
@test @doc(dynamic_test) == "test 2 Union{}" | |||
@test @doc(dynamic_test(::String)) == "test 2 Tuple{String}" | |||
|
|||
@test Docs._repl(:(dynamic_test(1.0))) == Expr(:escape, Expr(:macrocall, Symbol("@doc"), LineNumberNode(196, doc_util_path), :(dynamic_test(::typeof(1.0))))) | |||
@test Docs._repl(:(dynamic_test(::String))) == Expr(:escape, Expr(:macrocall, Symbol("@doc"), LineNumberNode(196, doc_util_path), :(dynamic_test(::String)))) | |||
@test Docs._repl(:(dynamic_test(1.0))) == Expr(:escape, Expr(:macrocall, Symbol("@doc"), LineNumberNode(214, doc_util_path), :(dynamic_test(::typeof(1.0))))) |
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 really dislike these tests...
x-ref #22870 where this has been also discussed |
This is done by printing a vertical line next to each separate docstring
Before (hard to see where one docstring ends and the other starts):
After:
This line is only showed when there are multiple docstrings, otherwise print as usual.