@@ -336,11 +336,13 @@ 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
@@ -358,9 +360,17 @@ f(x::Int, y::Int; a, b...)
358360```
359361````
360362"""
361- const TYPEDSIGNATURES = TypedMethodSignatures ()
363+ const TYPEDSIGNATURES = TypedMethodSignatures (true )
364+
365+ """
366+ An alternative to [`TYPEDSIGNATURES`](@ref) that omits the return type.
367+
368+ The return type shown by [`TYPEDSIGNATURES`](@ref) is often `-> Any`, which is usually not
369+ correct. It is nicer to then just omit the type completely.
370+ """
371+ const TYPEDSIGNATURESNORETURN = TypedMethodSignatures (false )
362372
363- function format (:: TypedMethodSignatures , buf, doc)
373+ function format (tms :: TypedMethodSignatures , buf, doc)
364374 local binding = doc. data[:binding ]
365375 local typesig = doc. data[:typesig ]
366376 local modname = doc. data[:module ]
@@ -395,7 +405,8 @@ function format(::TypedMethodSignatures, buf, doc)
395405 else
396406 t = tuples[findfirst (f, tuples)]
397407 end
398- printmethod (buf, binding, func, method, t)
408+ printmethod (buf, binding, func, method, t;
409+ print_return_types= tms. return_types)
399410 println (buf)
400411 end
401412 println (buf, " \n ```\n " )
0 commit comments