Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: pkg/docgen/lib/src/models/model_helpers.dart

Issue 268583002: Access parameter data in Annotations, as well as fixed export visibility (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/src/models/annotation.dart ('k') | pkg/docgen/test/multi_library_code/lib/test_lib2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/models/model_helpers.dart
diff --git a/pkg/docgen/lib/src/models/model_helpers.dart b/pkg/docgen/lib/src/models/model_helpers.dart
index fa56731ecb1c13bab98c878bcabafb421bec8cc5..48babc9cc1d6f4acc563d0280884c5d081f5c4fc 100644
--- a/pkg/docgen/lib/src/models/model_helpers.dart
+++ b/pkg/docgen/lib/src/models/model_helpers.dart
@@ -78,16 +78,15 @@ String getDefaultValueFromConstMirror(
/// Returns a list of meta annotations assocated with a mirror.
List<Annotation> createAnnotations(DeclarationMirror mirror,
Library owningLibrary) {
- var annotationMirrors = mirror.metadata
- .where((e) => e is dart2js_mirrors.Dart2JsConstructedConstantMirror);
var annotations = [];
- annotationMirrors.forEach((annotation) {
- var docgenAnnotation = new Annotation(annotation, owningLibrary);
+ for (dart2js_mirrors.ResolvedNode node in
+ dart2js_mirrors.BackDoor.metadataSyntaxOf(mirror)) {
+ var docgenAnnotation = new Annotation(node, owningLibrary);
if (!_SKIPPED_ANNOTATIONS.contains(dart2js_util.qualifiedNameOf(
docgenAnnotation.mirror))) {
annotations.add(docgenAnnotation);
}
- });
+ }
return annotations;
}
@@ -157,6 +156,15 @@ Map<String, Map<String, DeclarationMirror>> calcExportedItems(
// Determine the classes, variables and methods that are exported for a
// specific dependency.
void _populateExports(LibraryDependencyMirror export, bool showExport) {
+ var transitiveExports = calcExportedItems(export.targetLibrary);
+ exports['classes'].addAll(transitiveExports['classes']);
+ exports['methods'].addAll(transitiveExports['methods']);
+ exports['variables'].addAll(transitiveExports['variables']);
+ // If there is a show in the export, add only the show items to the
+ // library. Ex: "export foo show bar"
+ // Otherwise, add all items, and then remove the hidden ones.
+ // Ex: "export foo hide bar"
+
if (!showExport) {
// Add all items, and then remove the hidden ones.
// Ex: "export foo hide bar"
@@ -199,10 +207,6 @@ Map<String, Map<String, DeclarationMirror>> calcExportedItems(
Iterable<LibraryDependencyMirror> exportList =
library.libraryDependencies.where((lib) => lib.isExport);
for (LibraryDependencyMirror export in exportList) {
- // If there is a show in the export, add only the show items to the
- // library. Ex: "export foo show bar"
- // Otherwise, add all items, and then remove the hidden ones.
- // Ex: "export foo hide bar"
_populateExports(export,
export.combinators.any((combinator) => combinator.isShow));
}
« no previous file with comments | « pkg/docgen/lib/src/models/annotation.dart ('k') | pkg/docgen/test/multi_library_code/lib/test_lib2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698