Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsystem refactoring #13330

Merged
merged 2 commits into from
Sep 28, 2015
Merged

Conversation

MichaelHatherly
Copy link
Member

Minor docsystem refactoring.

Combines the doc(::Function) and doc(::DataType) methods since they were nearly identical.

Enables searching for docstrings attached to specific constructors in the same manner as is currently allowed for normal methods. Prior to this it resulted in a no method error.

Fixes #12701 where splatted method docs were shadowing others. Although not the original cause of the issue, with the change to storing signatures as Tuple{...} (in #12835) this meant that f(x...) was stored as Tuple{Vararg{Any}} which is equal to Tuple. Since the default value of sig was Tuple not all matching docs were returned in the example provided in #12701.

Simplify @repl implementation.

Enable apropos search via help mode by passing a string or regex:

help?> "foo"
help?> r"foo"

This shouldn't interfere with any docstring lookup since we don't encourage documenting specific strings or regex objects. Docs for @r_str can still be found by either using an empty regex r"" or @r_str directly.

Enable specifying method signatures using

help?> f(::Float64, ::Int)

as well as the current behaviour

help?> f(x, y)

where x and y are already defined. This is quite useful when you don't have an instance of the required type. Prior to this an error was thrown in gen_call_with_extracted_types when using the :: syntax.

Tests are failing with

    From worker 3:       * backtrace            Test Failed
    From worker 3:    Expression: (code_loc(b1[4]))[1] == (code_loc(b2[4]))[1] == :test_throw_commoning
    From worker 3:     Evaluated: test_throw_commoning == ??? == test_throw_commoning
    From worker 2:   in  30.63 seconds

julia/test$ make docs does pass for me locally though.

Combines the `doc(::Function)` and `doc(::DataType)` methods since they
were nearly identical.

Enables searching for docstrings attached to specific constructors in the
same manner as is currently allowed for normal methods. Prior to this it
resulted in a no method error.

Fixes JuliaLang#12701 where splatted method docs were shadowing others. Although not
the original cause of the issue, with the change to storing signatures
as `Tuple{...}` (in JuliaLang#12835) this meant that `f(x...)` was stored as
`Tuple{Vararg{Any}}` which is equal to `Tuple`. Since the default value of
`sig` was `Tuple` not all matching docs were returned in the example
provided in JuliaLang#12701.
Enable `apropos` search via help mode by passing a string or regex:

    help?> "foo"
    help?> r"foo"

This shouldn't interfere with any docstring lookup since we don't encourage
documenting specific strings or regex objects. Docs for `@r_str` can still
be found by searching for either an empty regex `r""` or `@r_str` directly.

Enable specifying method signatures using

    help?> f(::Float64, ::Int)

as well as the current behaviour

    help?> f(x, y)

where `x` and `y` are already defined. This is quite useful when you don't
have an instance of the required type. Prior to this an error was thrown
in `gen_call_with_extracted_types` when using the `::` syntax.
@tkelman tkelman added the docsystem The documentation building system label Sep 27, 2015
@ScottPJones
Copy link
Contributor

The backtrace problem is known about and is not related, I'm also waiting for a fix.

@MichaelHatherly
Copy link
Member Author

The backtrace problem is known about and is not related, I'm also waiting for a fix.

Yeah, #13322 was merged which looks like it's meant to address the problem.

@jakebolewski
Copy link
Member

Much needed, thanks!

jakebolewski added a commit that referenced this pull request Sep 28, 2015
@jakebolewski jakebolewski merged commit 26a4df7 into JuliaLang:master Sep 28, 2015
tkelman pushed a commit that referenced this pull request Sep 28, 2015
Combines the `doc(::Function)` and `doc(::DataType)` methods since they
were nearly identical.

Enables searching for docstrings attached to specific constructors in the
same manner as is currently allowed for normal methods. Prior to this it
resulted in a no method error.

Fixes #12701 where splatted method docs were shadowing others. Although not
the original cause of the issue, with the change to storing signatures
as `Tuple{...}` (in #12835) this meant that `f(x...)` was stored as
`Tuple{Vararg{Any}}` which is equal to `Tuple`. Since the default value of
`sig` was `Tuple` not all matching docs were returned in the example
provided in #12701.

(cherry picked from commit 1b1e6c6)
ref #13330
@MichaelHatherly
Copy link
Member Author

Thanks.

@MichaelHatherly MichaelHatherly deleted the mh/docsys-fixes branch September 29, 2015 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants