Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

LineNumberNodes for doctest

Open fredrikekre opened this issue 4 years ago • 1 comments

I'd like to do #1634 also for jldoctest but that is breaking if people assume that the file is "none". Searching gives https://juliahub.com/ui/Search?q=none%3A&type=code&f=.jl so there is a couple, probably not all of them are jldoctest though, but here is at least one example: https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/841a613cba35ab8a578642f48a87f07e2f962f68/src/construct.jl#L618

The current situation is not very nice either since you have to manually scrub the filename and add none. Perhaps doctest checking can try to ignore the filename, or we can allow both none and REPL[.*] for repl doctests.

fredrikekre avatar Jul 07 '21 11:07 fredrikekre

REPL[] things would correspond to what you get if you copy-paste the doctest into the REPL, right? You're right that changing this would be breaking, but we could have that in 0.28 I think.

I don't think it's worth having the complexity of checking for none at the same time. You'd have to run the doctest twice with different LineNumberNodes? Or were you thinking of doing some regex magic?

mortenpi avatar Jul 07 '21 23:07 mortenpi