Skip to content

How to show default values and types of keyword arguments? #135

Closed as not planned
@bowenszhu

Description

@bowenszhu
using DocStringExtensions

"""
$(TYPEDSIGNATURES)
"""
function func(a::Integer, b::Integer = a; c::Integer = b)::Integer
    a + b + c
end

@doc func

gives

  func(a::Integer) -> Integer
  func(a::Integer, b::Integer; c) -> Integer

TYPEDSIGNATURES returns a simplified representation of method signatures, which, however, doesn't show the types and default values of keyword arguments. Is there a convenient way to also include them in the docstring?

The expected result is

func(a::Integer, b::Integer = a; c::Integer = b) -> Integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions