Skip to content

Commit

Permalink
@debug the next REPL line before evaling it
Browse files Browse the repository at this point in the history
Add a `@debug` expression within DocTests.eval_repl to show which line is
about to be evaluated.
This was requested in
#2013
  • Loading branch information
musoke committed Jul 12, 2023
1 parent 7c97a86 commit fc38d33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DocTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fc38d33

Please sign in to comment.