JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.44k stars 5.46k forks source link

Documenting Fields of Parametric Type #29478

Open JaredCrean2 opened 5 years ago

JaredCrean2 commented 5 years ago

From Discourse

Trying to get the documentation for Bar.x works, but not Foo.x or Foo{Float64}.x:

# file tmp4.jl
"""
  This is struct Foo
"""
struct Foo{T}
  """
    This is field x
  """
  x
end

"""
  This is struct Bar
"""
struct Bar
  """
    This is field x
  """
  x
end

In the repl:

julia> include("tmp4.jl")
Bar

help?> Foo
search: floor pointer_from_objref OverflowError RoundFromZero FileMonitor functionloc StackOverflowError

  This is struct Foo

help?> Foo{Float64}.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Foo{Float64}}, ::Symbol)
Closest candidates are:
  Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12

help?> Foo.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Foo}, ::Symbol)
Closest candidates are:
  Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12

help?> Bar
search: baremodule SubArray GlobalRef BitArray clipboard backtrace BitMatrix takebuf_array catch_backtrace

  This is struct Bar

help?> Bar.x
  This is field x
Oblynx commented 4 years ago

I'm having the same issue.

SBuercklin commented 4 years ago

Also running up against this issue

lwhitefox commented 3 years ago

Me too!

navidcy commented 3 years ago

Same here!

vtjnash commented 3 years ago

More generally, we encounter that simple multi-dot expressions may run into this error:

help?> DataType.name.names
ERROR: MethodError: no method matching Base.Docs.Binding(::Core.TypeName, ::Symbol)
Closest candidates are:
  Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:9
Stacktrace:
 [1] top-level scope
   @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/REPL/src/docview.jl:505
ClaudMor commented 2 years ago

Same. Any update on this?