-
Notifications
You must be signed in to change notification settings - Fork 124
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
Major refactor of dartdoc "features" and annotations #2600
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the refactor!
lib/src/model/container_member.dart
Outdated
return _features; | ||
} | ||
Set<Feature> get features => | ||
{...super.features, if (isExtended) Feature.extended}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/src/model/feature.dart
Outdated
} | ||
|
||
/// A "feature" includes both explicit annotations in code (e.g. `deprecated`) | ||
/// as well as others added by the documentation systme (`read-write`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: system
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
lib/src/model/model_element.dart
Outdated
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021?
There was a problem hiding this comment.
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".
Fixes #2516.
Should supercede #2595 and #2599. Most of this is the refactor; once that's done, the implementation for type parameters is trivial.