You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sufficiently familiar with doc system to be efficient about this, but in case it helps, here's the start of a debugging session:
diff --git a/base/docs/Docs.jl b/base/docs/Docs.jl
index d409eea9a6..b9650d7fd9 100644
--- a/base/docs/Docs.jl+++ b/base/docs/Docs.jl@@ -215,6 +215,7 @@ Adds a new docstring `str` to the docsystem of `__module__` for `binding` and si
"""
function doc!(__module__::Module, b::Binding, str::DocStr, @nospecialize sig = Union{})
initmeta(__module__)
+ @show __module__ b str sig meta(__module__)
m = get!(meta(__module__), b, MultiDoc())
if haskey(m.docs, sig)
# We allow for docstrings to be updated, but print a warning since it is possible
julia>using Revise
julia> Revise.track(Base)
julia>"Outer docstring"module Outer
"Inner docstring"module Inner
"Inner2 docstring"module Inner2
endendend
__module__ = Main.Outer.Inner.Inner2
b = Main.Outer.Inner.Inner2
str = Base.Docs.DocStr(svec("Inner2 docstring"), nothing, Dict{Symbol,Any}(:module=>Main.Outer.Inner.Inner2,:linenumber=>3,:path=>"REPL[3]"))
sig = Union{}
meta(__module__) =IdDict{Any,Any}()
__module__ = Main.Outer.Inner
b = Main.Outer.Inner
str = Base.Docs.DocStr(svec("Inner docstring"), nothing, Dict{Symbol,Any}(:module=>Main.Outer.Inner,:linenumber=>2,:path=>"REPL[3]"))
sig = Union{}
meta(__module__) =IdDict{Any,Any}()
__module__ = Main.Outer
b = Outer
str = Base.Docs.DocStr(svec("Outer docstring"), nothing, Dict{Symbol,Any}(:module=>Main.Outer,:linenumber=>1,:path=>"REPL[3]"))
sig = Union{}
meta(__module__) =IdDict{Any,Any}()
Main.Outer
help?> Outer
search: Outer count_zeros RoundToZero OutOfMemoryError countlines count_ones RoundNearestTiesUp RoundNearestTiesAway
Outer docstring
help?> Outer.Inner
Inner docstring
help?> Outer.Inner.Inner2
Inner2 docstring
julia>"New outer docstring" Outer
__module__ = Main
b = Outer
str = Base.Docs.DocStr(svec("New outer docstring"), nothing, Dict{Symbol,Any}(:module=>Main,:linenumber=>1,:path=>"REPL[7]"))
sig = Union{}
meta(__module__) =IdDict{Any,Any}()
Outer
help?> Outer
search: Outer count_zeros RoundToZero OutOfMemoryError countlines count_ones RoundNearestTiesUp RoundNearestTiesAway
Outer docstring
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
New outer docstring
julia>"New inner docstring" Outer.Inner
__module__ = Main
b = Main.Outer.Inner
str = Base.Docs.DocStr(svec("New inner docstring"), nothing, Dict{Symbol,Any}(:module=>Main,:linenumber=>1,:path=>"REPL[9]"))
sig = Union{}
meta(__module__) =IdDict{Any,Any}(Outer=>MultiDoc(Type[Union{}], IdDict{Any,Any}(Union{}=>DocStr(svec("New outer docstring"), New outer docstring
, Dict{Symbol,Any}(:typesig=>Union{},:module=>Main,:linenumber=>1,:binding=>Outer,:path=>"REPL[7]")))))
Main.Outer.Inner
help?> Outer.Inner
Inner docstring
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
New inner docstring
julia>"This is foo"foo(x::Int) =1
__module__ = Main
b = foo
str = Base.Docs.DocStr(svec("This is foo"), nothing, Dict{Symbol,Any}(:module=>Main,:linenumber=>1,:path=>"REPL[11]"))
sig = Tuple{Int64}
meta(__module__) =IdDict{Any,Any}(Outer=>MultiDoc(Type[Union{}], IdDict{Any,Any}(Union{}=>DocStr(svec("New outer docstring"), New outer docstring
, Dict{Symbol,Any}(:typesig=>Union{},:module=>Main,:linenumber=>1,:binding=>Outer,:path=>"REPL[7]")))),Main.Outer.Inner=>MultiDoc(Type[Union{}], IdDict{Any,Any}(Union{}=>DocStr(svec("New inner docstring"), New inner docstring
, Dict{Symbol,Any}(:typesig=>Union{},:module=>Main,:linenumber=>1,:binding=>Main.Outer.Inner,:path=>"REPL[9]")))))
foo
help?> foo
search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc StackOverflowError @functionloc OutOfMemoryError UndefKeywordError unsafe_pointer_to_objref
This is foo
julia>"This is new foo"foo(x::Int) =2
__module__ = Main
b = foo
str = Base.Docs.DocStr(svec("This is new foo"), nothing, Dict{Symbol,Any}(:module=>Main,:linenumber=>1,:path=>"REPL[13]"))
sig = Tuple{Int64}
meta(__module__) =IdDict{Any,Any}(Outer=>MultiDoc(Type[Union{}], IdDict{Any,Any}(Union{}=>DocStr(svec("New outer docstring"), New outer docstring
, Dict{Symbol,Any}(:typesig=>Union{},:module=>Main,:linenumber=>1,:binding=>Outer,:path=>"REPL[7]")))),foo=>MultiDoc(Type[Tuple{Int64}], IdDict{Any,Any}(Tuple{Int64}=>DocStr(svec("This is foo"), This is foo
, Dict{Symbol,Any}(:typesig=>Tuple{Int64},:module=>Main,:linenumber=>1,:binding=>foo,:path=>"REPL[11]")))),Main.Outer.Inner=>MultiDoc(Type[Union{}], IdDict{Any,Any}(Union{}=>DocStr(svec("New inner docstring"), New inner docstring
, Dict{Symbol,Any}(:typesig=>Union{},:module=>Main,:linenumber=>1,:binding=>Main.Outer.Inner,:path=>"REPL[9]")))))
foo
help?> foo
search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc StackOverflowError @functionloc OutOfMemoryError UndefKeywordError unsafe_pointer_to_objref
This is new foo
The text was updated successfully, but these errors were encountered:
When updating a module docstring, the old one is retained, which is probably not the behavior we want. Demo:
I'm not sufficiently familiar with doc system to be efficient about this, but in case it helps, here's the start of a debugging session:
The text was updated successfully, but these errors were encountered: