Chromium Code Reviews| 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. |
| */ |