Skip to content

Commit

Permalink
#54749, #54831: Prevent JuliaSyntax docs from leaking into Base
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Jul 15, 2024
1 parent e625464 commit 262aa27
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ end

function initmeta(m::Module)
if !isdefined(m, META) || getfield(m, META) === nothing
if contains(string(m), "JuliaSyntax")
# prevent JuliaSyntax docs from leaking into Base because it's an implementation detail
return nothing
end
Core.eval(m, :($META = $(METAType())))
push!(modules, m)
end
Expand Down Expand Up @@ -371,6 +375,7 @@ function keyworddoc(__source__, __module__, str, def::Base.BaseDocs.Keyword)
end

function objectdoc(__source__, __module__, str, def, expr, sig = :(Union{}))
println("running objectdoc")
@nospecialize str def expr sig
binding = esc(bindingexpr(namify(expr)))
docstr = esc(docexpr(__source__, __module__, lazy_iterpolate(str), metadata(__source__, __module__, expr, false)))
Expand Down Expand Up @@ -564,6 +569,7 @@ isbasicdoc(@nospecialize x) = isexpr(x, :.) || isa(x, Union{QuoteNode, Symbol})
is_signature(@nospecialize x) = isexpr(x, :call) || (isexpr(x, :(::), 2) && isexpr(x.args[1], :call)) || isexpr(x, :where)

function _doc(binding::Binding, sig::Type = Union{})
println("running _doc")
if defined(binding)
result = getdoc(resolve(binding), sig)
result === nothing || return result
Expand Down

0 comments on commit 262aa27

Please sign in to comment.