Skip to content

Major refactor of dartdoc "features" and annotations #2600

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

Conversation

jcollins-g
Copy link
Contributor

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

Fixes #2516.

Should supercede #2595 and #2599. Most of this is the refactor; once that's done, the implementation for type parameters is trivial.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Mar 30, 2021
@jcollins-g jcollins-g marked this pull request as ready for review March 31, 2021 16:12
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.

Love the refactor!

return _features;
}
Set<Feature> get features =>
{...super.features, if (isExtended) Feature.extended};
Copy link
Member

Choose a reason for hiding this comment

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

If this will be more readable on multiple lines, a trailing comma will force that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

/// A "feature" includes both explicit annotations in code (e.g. `deprecated`)
/// as well as others added by the documentation systme (`read-write`);
Copy link
Member

Choose a reason for hiding this comment

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

typo: system

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

// TODO(jcollins-g): consider [Comparable]?
final int sortGroup;

static const readOnly = Feature('read-only', 1);
Copy link
Member

Choose a reason for hiding this comment

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

Haha I had this exact same idea. Excellent.

Iterable<Annotation> _annotations;
// Skips over annotations with null elements or that are otherwise
// supposed to be invisible (@pragma). While technically they are
// invalid code from analyzer's perspective they are present in sky_engine
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how to read this sentence. An annotation like @pragma is invalid? Does invalid mean analyzer crashes or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This got lost in multiple rewrites; the only indicator of invalid code is the null element. Updated.

@@ -0,0 +1,63 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
Copy link
Member

Choose a reason for hiding this comment

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

2021?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. this was actually a rename from the old "FeatureRenderer".

@jcollins-g jcollins-g merged commit 342d2d7 into dart-lang:master Apr 2, 2021
@jcollins-g jcollins-g deleted the generic-metadata+refactor-feature branch April 2, 2021 15:53
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.

Add support for type arguments on annotations
2 participants