Skip to content

Commit 5b8cb58

Browse files
committed
fix macro repl help lookup, add test
1 parent 49c08d2 commit 5b8cb58

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

base/docs/utils.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ macro repl(ex)
114114
if $(isfield(ex) ? :(isa($(esc(ex.args[1])), DataType)) : false)
115115
$(isfield(ex) ? :(fielddoc($(esc(ex.args[1])), $(ex.args[2]))) : nothing)
116116
else
117-
$((isa(ex,Symbol) || isfield(ex)) ? :($doc($(esc(ex)))) : Base.gen_call_with_extracted_types(doc, ex))
117+
$((isa(ex,Symbol) || isfield(ex) || isexpr(ex,:macrocall)) ? :(@doc ($(esc(ex)))) : Base.gen_call_with_extracted_types(doc, ex))
118118
end
119119
end
120120
end

test/docs.jl

+3
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,6 @@ f12593_2() = 1
266266
# crude test to make sure we sort docstring output by method specificity
267267
@test !docstrings_equal(Docs.doc(getindex, Tuple{Dict{Int,Int},Int}),
268268
Docs.doc(getindex, Tuple{Type{Int64},Int}))
269+
270+
# test that macro documentation works
271+
@test (Docs.@repl @assert) !== nothing

0 commit comments

Comments
 (0)