Skip to content

Implement generic function type syntax in dartdoc #1321

Closed
@bwilkerson

Description

@bwilkerson

This is the dartdoc-implementation issue for dart-lang/sdk#27527.

Activity

added
P1A high priority bug; for example, a single project is unusable or has many test failures
on Jan 10, 2017
devoncarew

devoncarew commented on Jan 19, 2017

@devoncarew
Member

punted to 1.23

mit-mit

mit-mit commented on Mar 15, 2017

@mit-mit
Member

@devoncarew who should this be assigned to?

jcollins-g

jcollins-g commented on Mar 15, 2017

@jcollins-g
Contributor

I'm willing to take a look, but it looks like from the description, it will be dependent on analyzer support.

devoncarew

devoncarew commented on Mar 15, 2017

@devoncarew
Member

@jcollins-g, thanks! If this needs a new analyzer library, we can either backport the necessary work to the 0.29 release of analyzer, release an entirely new 0.30 version, or solve the issue by moving dartdoc into the sdk repo.

devoncarew

devoncarew commented on Mar 15, 2017

@devoncarew
Member

It looks like dart_style (dart-lang/dart_style#563) will also need a version of the analyzer w/ generic function type support.

mit-mit

mit-mit commented on Mar 27, 2017

@mit-mit
Member

Analyzer is done!

jcollins-g

jcollins-g commented on Mar 27, 2017

@jcollins-g
Contributor

I'll start looking at this today.

dgrove

dgrove commented on Mar 28, 2017

@dgrove

The last full push to trunk is Wednesday early morning. Is this likely to land by then?

jcollins-g

jcollins-g commented on Mar 28, 2017

@jcollins-g
Contributor

Implementation & tests complete, assuming I understand the feature correctly. Blocking on landing of cl 2778253002, landing a backport of this and related CLs to the analyzer 0.29 branch in SDK, publishing the new analyzer package, and then submitting my change to dartdoc. So it is going to be hard to get all that done in the next several hours.

Declared NewGenericTypedef as below:

/// A typedef with the new style generic function syntax.
typedef NewGenericTypedef<T> = List<T> Function<T>(int);

Screenshots:
screenshot from 2017-03-28 11 02 28
screenshot from 2017-03-28 11 03 24

keertip

keertip commented on Mar 28, 2017

@keertip
Collaborator

Looks good! See the generic type info 👍

jcollins-g

jcollins-g commented on Mar 28, 2017

@jcollins-g
Contributor

@bwilkerson I think these are the blocking items we need from analyzer:

  • CL 2778253002 must land
  • Above CL and other CLs needed to make this analyze cleanly must be published in an analyzer package, so we can avoid errors like line 126-132 here

8 remaining items

jcollins-g

jcollins-g commented on Mar 29, 2017

@jcollins-g
Contributor

Now that I understand the feature better I think this really does need to be improved.

New screenshots showing the change:

screenshot from 2017-03-29 09 35 42
screenshot from 2017-03-29 09 36 09

It's still not great; note how <S> appears in some places and <T> in others, which is confusing. But it seems more correct than before. I decided to place <S> in the library doc as that seems more consistent with how generic functions (without typedefs) are handled, but I'm open to changing that if there's something that's more intuitive people can suggest.

jcollins-g

jcollins-g commented on Mar 29, 2017

@jcollins-g
Contributor

CL 2787513003 uploaded for analyzer, generic-function-types branch updated with new tests. dartdoc branch is still pending a published version of analyzer containing these changes.

added
status-blockedBlocked from making progress by another (referenced) issue
on Mar 30, 2017
mit-mit

mit-mit commented on Apr 3, 2017

@mit-mit
Member

@jcollins-g @bwilkerson where are we at with this one?

jcollins-g

jcollins-g commented on Apr 3, 2017

@jcollins-g
Contributor

I'm going to tag the branch and manually test dartdoc merged with the SDK today, and we can ship an SDK that contains dartdoc (even though dartdoc head is broken).

jcollins-g

jcollins-g commented on Apr 3, 2017

@jcollins-g
Contributor
devoncarew

devoncarew commented on Apr 4, 2017

@devoncarew
Member
jcollins-g

jcollins-g commented on Apr 5, 2017

@jcollins-g
Contributor

Now that the revision is merged to the SDK, I'm OK with removing the 1.23 tag. Don't want to close until we have an analyzer published package containing the changes.

removed
status-blockedBlocked from making progress by another (referenced) issue
on Apr 5, 2017
jcollins-g

jcollins-g commented on May 26, 2017

@jcollins-g
Contributor

Support is in published dartdoc with 0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failurescustomer-flutterIssues originating from important to Flutter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Hixie@devoncarew@dgrove@keertip@bwilkerson

      Issue actions

        Implement generic function type syntax in dartdoc · Issue #1321 · dart-lang/dartdoc