Skip to content

include defaults for Base.@kwdef structs in FIELDS (or something else) #182

@tpapp

Description

@tpapp

In a struct that was defined with Base.@kwdef, is it possible to generate a docstring similar to what FIELDS currently does, but with defaults? MWE:

using DocStringExtensions

"""
$(FIELDS)
"""
Base.@kwdef struct Foo
    a::Int = 1
end

should show something like

  • a = 1

I am not even sure if this is conceptually possible though, or if there is a reasonable workaround. Related: #19.

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