Skip to content

Rewrite parameter handling and add required named parameters for nnbd #2075

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 2 commits into from
Nov 19, 2019

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Nov 15, 2019

Fixes #2059, #2052.

The linkedParams / linkedParamsLines implementation has turned into a hot mess over time. This rewrites the parameter rendering to abstract the HTML portion of the rendering and use list items to organize the display of parameters on method pages. Minimal changes to existing tests have been made to make them pass; at some point, a better suite of tests for the new structure could replace a lot of the cut and paste of literal HTML in model_test.dart.

Screenshots:
new-regexp-con
(compare to https://api.dartlang.org/dev/2.7.0-dev.0.0/dart-core/RegExp/RegExp.html)

new-regexp
(compare to https://api.dartlang.org/dev/2.7.0-dev.0.0/dart-core/RegExp-class.html)

Required parameter in action:
new-b-class

new-b-m1-method

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Nov 15, 2019
@coveralls
Copy link

coveralls commented Nov 15, 2019

Coverage Status

Coverage increased (+0.04%) to 93.904% when pulling d39f125 on required-param into ab52275 on master.

@devoncarew
Copy link
Member

It looks like named params are getting a 2x indent; their indent should likely match the indent of regular, required params (for the first screenshot, {bool multiLine: false and following).

@jcollins-g
Copy link
Contributor Author

Screen Shot 2019-11-18 at 1 47 48 PM

Done, I liked the other way better visually, but this is more consistent.

@jcollins-g
Copy link
Contributor Author

@devoncarew PTAL?

Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

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

lgtm; I like the refactoring into specialized ParameterRenderer subclasses.

@jcollins-g
Copy link
Contributor Author

@devoncarew Glad you like it. @jdkoren and I are coordinating to extract more of the rendering goop out in this manner.

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.

Optional function/method parameters incorrectly formatted
4 participants