@@ -336,17 +336,25 @@ end
336336#
337337
338338"""
339- The singleton type for [`TYPEDSIGNATURES`](@ref) abbreviations.
339+ The type for [`TYPEDSIGNATURES`](@ref) abbreviations.
340340
341341$(:FIELDS)
342342"""
343- struct TypedMethodSignatures <: Abbreviation end
343+ struct TypedMethodSignatures <: Abbreviation
344+ return_types:: Bool
345+ end
344346
345347"""
346348An [`Abbreviation`](@ref) for including a simplified representation of all the method
347349signatures with types that match the given docstring. See [`printmethod`](@ref) for details on
348350the simplifications that are applied.
349351
352+ !!! tip "Disabling the Return Type"
353+ In many codebases the return types are not annotated meaning the return
354+ type is printed as `Any`. To reduce clutter, the return type may be omitted by
355+ calling [`TypedMethodSignatures`](@ref) and passing `false` to its constructor:
356+ `\$ (TypedMethodSignatures(false))`.
357+
350358# Examples
351359
352360The generated markdown text will look similar to the following example where a function `f`
@@ -358,9 +366,9 @@ f(x::Int, y::Int; a, b...)
358366```
359367````
360368"""
361- const TYPEDSIGNATURES = TypedMethodSignatures()
369+ const TYPEDSIGNATURES = TypedMethodSignatures(true )
362370
363- function format(:: TypedMethodSignatures , buf, doc)
371+ function format(tms :: TypedMethodSignatures , buf, doc)
364372 local binding = doc. data[:binding]
365373 local typesig = doc. data[:typesig]
366374 local modname = doc. data[:module]
@@ -395,7 +403,8 @@ function format(::TypedMethodSignatures, buf, doc)
395403 else
396404 t = tuples[findfirst(f, tuples)]
397405 end
398- printmethod(buf, binding, func, method, t)
406+ printmethod(buf, binding, func, method, t;
407+ print_return_types= tms. return_types)
399408 println(buf)
400409 end
401410 println(buf, " \n ```\n " )
0 commit comments