Skip to content

Revise should replace docstring rather than adding to it #927

@Keno

Description

@Keno

38258 added the ability to run doctests with Revise. Unfortunately, this option doesn't seem to actually be working, because Revise adds the new doctest rather than replacing the old one. E.g. here's me trying to work on the jldoctest of getaddrinfo:

julia> (@doc(Sockets.getaddrinfo)).content
2-element Vector{Any}:
 ```julia
getaddrinfo(host::AbstractString, IPAddr) -> IPAddr
```

Gets the first IP address of the `host` of the specified `IPAddr` type. Uses the operating system's underlying getaddrinfo implementation, which may do a DNS lookup.

# Examples

```jldoctest; filter = r"(ip"::1"|ERROR: DNSError:.*|Stacktrace:(\n \[0-9]+\].*)*)
julia> getaddrinfo("localhost", IPv6)
ip"::1"

julia> getaddrinfo("localhost", IPv4)
ip"127.0.0.1"
```

 ```julia
getaddrinfo(host::AbstractString) -> IPAddr
```

Gets the first available IP address of `host`, which may be either an `IPv4` or `IPv6` address. Uses the operating system's underlying getaddrinfo implementation, which may do a DNS lookup.
julia> using Revise

julia> Revise.track(Sockets)
julia> (@doc(Sockets.getaddrinfo))
3-element Vector{Any}:
 ```julia
getaddrinfo(host::AbstractString, IPAddr) -> IPAddr
```

Gets the first IP address of the `host` of the specified `IPAddr` type. Uses the operating system's underlying getaddrinfo implementation, which may do a DNS lookup.

# Examples

```jldoctest; filter = r"(ip"::1"|ERROR: DNSError:.*|Stacktrace:(\n \[0-9]+\].*)*)
julia> getaddrinfo("localhost", IPv6)
ip"::1"

julia> getaddrinfo("localhost", IPv4)
ip"127.0.0.1"
```

 ```julia
getaddrinfo(host::AbstractString) -> IPAddr
```

Gets the first available IP address of `host`, which may be either an `IPv4` or `IPv6` address. Uses the operating system's underlying getaddrinfo implementation, which may do a DNS lookup.

 ```julia
getaddrinfo(host::AbstractString, IPAddr) -> IPAddr
```

Gets the first IP address of the `host` of the specified `IPAddr` type. Uses the operating system's underlying getaddrinfo implementation, which may do a DNS lookup.

# Examples

```jldoctest; filter = r"(ip\"::1\"|ERROR: DNSError:.*|Stacktrace:(\\n \\[0-9]+\\].*)*)"
julia> getaddrinfo("localhost", IPv6)
ip"::1"

julia> getaddrinfo("localhost", IPv4)
ip"127.0.0.1"
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions