DocStringExtensions.jl icon indicating copy to clipboard operation
DocStringExtensions.jl copied to clipboard

Add support for default values to `TYPEDSIGNATURES`

Open JamesWrigley opened this issue 6 months ago • 13 comments

This is done by making TypedMethodSignatures interpolatable and giving it the Expr of the thing the docstring is bound to. From the AST we can parse each arguments name, type annotation, default value, and whether or not it's variadic. Currently only the default value is used in TYPEDSIGNATURES, though in the future it might be an idea to use the type information as well.

I think this could do with some more tests (parsing is hard :cry:), but it's pretty close to being complete. Fixes #107, fixes #19. Would make #97 possible if we're ok with getting the types from the AST.

JamesWrigley avatar Aug 15 '24 18:08 JamesWrigley