Can I get the help mode in some other way than by pressing the questionmark key?
Docs.doc(binding, sig::Type) will give help on a function method, but doesn’t enter the help mode
There is also the
@doc macro which returns the docstring.
That is true. However, the macro does not have the “fuzzy search” capability of the help mode:
This is a good point. Unfortunately no search is possible, one either knows the precise binding and can use this, or is out of luck.
The REPL help mode is implemented with the
julia> REPL.@repl coll search: collect code_llvm @code_llvm Colon coalesce complex Complex ComplexF64 ComplexF32 ComplexF16 countlines code_lowered Cdouble Clonglong @code_lowered precompile functionloc cglobal Culonglong Couldn't find coll Perhaps you meant conj, copy, cos, cosc, cosd, cosh, cot, cotd, coth, ceil, cld, ccall, all, fill, foldl, kill, Bool, collect, Colon, Core, conj!, copy!, cospi, count, const, acos, acosd, acosh or acot No documentation found. Binding coll does not exist.
And how do we find where REPL.@repl is defined?
Tried, but …
julia> @which REPL.@repl WARNING: Base.REPL is deprecated, run `using REPL` instead in module Main ERROR: no unique matching method found for the specified argument types
julia> using REPL; @which REPL.@repl sum @repl(__source__::LineNumberNode, __module__::Module, ex) in REPL at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/docview.jl:274
But since I found the ripgrep (rg) tool I sometimes just grep the julia codebase, it’s almost instantaneous, i.e.
[snip]/julia (master)$ rg "macro repl" . ./stdlib/REPL/src/docview.jl 274:macro repl(ex) repl(ex) end 275:macro repl(io, ex) repl(io, ex) end
Ah, thanks (I’d visited that file after some grepping but couldn’t find the right spot)