From fc38d330de7d7a02e168994dc79d30588e3e8113 Mon Sep 17 00:00:00 2001 From: Nathan Musoke Date: Tue, 11 Jul 2023 17:53:48 -0400 Subject: [PATCH] `@debug` the next REPL line before evaling it Add a `@debug` expression within DocTests.eval_repl to show which line is about to be evaluated. This was requested in https://github.com/JuliaDocs/Documenter.jl/issues/2013 --- src/DocTests.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DocTests.jl b/src/DocTests.jl index f2bdd9291c..7639fc82b9 100644 --- a/src/DocTests.jl +++ b/src/DocTests.jl @@ -242,6 +242,8 @@ end function eval_repl(block, sandbox, meta::Dict, doc::Documenter.Document, page) for (input, output) in repl_splitter(block.code) result = Result(block, input, output, meta[:CurrentFile]) + src_lines = Documenter.find_block_in_file(result.block.code, result.file) + @debug "Evaluating doctest REPL line from $(Documenter.locrepr(result.file, src_lines))" input expected_output = output for (ex, str) in Documenter.parseblock(input, doc, page; keywords = false, raise=false) # Input containing a semi-colon gets suppressed in the final output. result.hide = REPL.ends_with_semicolon(str)