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

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 19500014: Typedef information showing properly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index 415102a25614d80fb95d902ea0bceabdb8920941..dbc8b206922a858c7a885fa77c93f60750ded018 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -383,7 +383,10 @@ Map<String, Class> _getClasses(Map<String, ClassMirror> mirrorMap,
if (isError(mirror.qualifiedName)) {
errors[mirrorName] = clazz;
} else if (mirror.isTypedef) {
- typedefs[mirrorName] = clazz;
+ typedefs[mirrorName] = new Typedef(mirrorName,
+ mirror.value.returnType.qualifiedName, _getComment(mirror),
+ _getGenerics(mirror), _getParameters(mirror.value.parameters),
+ _getAnnotations(mirror), mirror.qualifiedName);
} else if (mirror.isAbstract) {
abstractClasses[mirrorName] = clazz;
} else if (mirror.isClass) {
@@ -552,6 +555,37 @@ class Class extends Indexable {
}
}
+class Typedef extends Indexable {
+ String name;
Alan Knight 2013/07/19 20:28:15 Do all Indexables have a name? Could this be pushe
janicejl 2013/07/19 21:26:57 Done. I have moved name and comment up to indexabl
+ String returnType;
+
+ /// Documentation comment with converted markdown.
+ String comment;
+
+ Map<String, Parameter> parameters;
+
+ /// Generic information about the typedef.
+ Map<String, Generic> generics;
+
+ /// List of the meta annotations on the typedef.
+ List<String> annotations;
+
+ Typedef(this.name, this.returnType, this.comment, this.generics,
+ this.parameters, this.annotations,
+ String qualifiedName) : super(qualifiedName) {}
+
+ Map toMap() {
+ var typedefMap = {};
+ typedefMap['name'] = name;
Alan Knight 2013/07/19 20:28:15 Either write this as a literal map, or use cascade
janicejl 2013/07/19 21:26:57 Done. Also modified all the other toMap functions
+ typedefMap['comment'] = comment;
+ typedefMap['return'] = returnType;
+ typedefMap['parameters'] = recurseMap(parameters);
+ typedefMap['annotations'] = new List.from(annotations);
+ typedefMap['generics'] = recurseMap(generics);
+ return typedefMap;
+ }
+}
+
/**
* A class containing properties of a Dart variable.
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698