Skip to content

Introduce basic generic type alias support for dartdoc #2558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 8, 2021

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Mar 4, 2021

This introduces basic generic type alias support. We no longer crash when encountering them in most (all?) cases, and do something reasonable in the documentation (though arguably it could be prettier).

Screen Shot 2021-03-04 at 3 05 03 PM

There are a few additional tests and tweaks I would like to add before declaring #2499 fixed. In particular, when aliasing special types like void this currently does not properly refer to the type alias when it is referenced later (instead displaying void). I also have an idea to programmatically generate dartdoc documentation from SDK language tests for a visual inspection to identify problems like this that I want to implement.

Nevertheless, this is pretty close and if we absolutely had to we could likely ship with this and patch up the rest later.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Mar 4, 2021
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 91.858% when pulling 1097818 on jcollins-g:generic-type-aliases into cab6931 on dart-lang:master.

@jcollins-g jcollins-g requested a review from srawlins March 5, 2021 16:53
Copy link
Member

@srawlins srawlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid implementation; no surprises

T4 = generalizedTypedefs.typedefs.firstWhere((a) => a.name == 'T4');
T5 = generalizedTypedefs.typedefs.firstWhere((a) => a.name == 'T5');
T6 = generalizedTypedefs.typedefs.firstWhere((a) => a.name == 'T6');
T7 = generalizedTypedefs.typedefs.firstWhere((a) => a.name == 'T7');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great tests

@jcollins-g jcollins-g merged commit f04164b into dart-lang:master Mar 8, 2021
@jcollins-g jcollins-g deleted the generic-type-aliases branch March 8, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants