dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

Change the formatting of parameters that are function types.

Open kallentu opened this issue 4 months ago • 0 comments

Related to this PR https://github.com/dart-lang/dartdoc/pull/3670 All function type parameters are currently in the format of <return-type> <name><type-parameters>()

For example, for source code of:

Object? extractIterableTypeArgument(
        Iterable iterable, Object? Function<T>() extract) =>
    internal.extractTypeArguments<Iterable>(iterable, extract);

Dartdoc renders it as:

extractIterableTypeArgument(Iterable iterable, Object? extract<T>()) → Object?

Object? extract<T>() instead of Object? Function<T>() extract

So perhaps change the format to one of the following

  • Always display the new format.
  • Always display what is in the source code; if they wrote the old school format, support that. There are plenty of cases in the Dart SDK at least that use the old school format, like Future.then.

kallentu avatar Feb 22 '24 18:02 kallentu