Chromium Code Reviews| Index: pkg/dartdoc/dartdoc.dart |
| diff --git a/pkg/dartdoc/dartdoc.dart b/pkg/dartdoc/dartdoc.dart |
| index d68f40abad88ed52ce1ba18d1c8ba75bf3e5123f..30a9a70748df2caf35241981e11d341433a37c8b 100644 |
| --- a/pkg/dartdoc/dartdoc.dart |
| +++ b/pkg/dartdoc/dartdoc.dart |
| @@ -779,6 +779,7 @@ class Dartdoc { |
| // Document the types. |
| final classes = <InterfaceMirror>[]; |
| final interfaces = <InterfaceMirror>[]; |
| + final typedefs = <TypedefMirror>[]; |
| final exceptions = <InterfaceMirror>[]; |
| for (InterfaceMirror type in orderByName(library.types.getValues())) { |
| @@ -788,13 +789,17 @@ class Dartdoc { |
| exceptions.add(type); |
| } else if (type.isClass) { |
| classes.add(type); |
| - } else { |
| + } else if (type.isInterface){ |
| interfaces.add(type); |
| + } else { |
| + assert(type is TypedefMirror); |
|
ahe
2012/08/21 08:50:28
This is one of the many places where an assertion
Johnni Winther
2012/08/21 09:30:27
Done.
|
| + typedefs.add(type); |
| } |
| } |
| docTypes(classes, 'Classes'); |
| docTypes(interfaces, 'Interfaces'); |
| + docTypes(typedefs, 'Typedefs'); |
| docTypes(exceptions, 'Exceptions'); |
| writeFooter(); |
| @@ -807,7 +812,7 @@ class Dartdoc { |
| } |
| } |
| - void docTypes(List<InterfaceMirror> types, String header) { |
| + void docTypes(List types, String header) { |
| if (types.length == 0) return; |
| writeln('<h3>$header</h3>'); |
| @@ -989,14 +994,11 @@ class Dartdoc { |
| writeln('<span class="show-code">Code</span>'); |
| } |
| - if (type.definition !== null) { |
| - // TODO(johnniwinther): Implement [:TypedefMirror.definition():]. |
| - write('typedef '); |
| - annotateType(type, type.definition, type.simpleName); |
| + write('typedef '); |
| + annotateType(type, type.definition, type.simpleName); |
| - write(''' <a class="anchor-link" href="#${type.simpleName}" |
| - title="Permalink to ${type.simpleName}">#</a>'''); |
| - } |
| + write(''' <a class="anchor-link" href="#${type.simpleName}" |
| + title="Permalink to ${type.simpleName}">#</a>'''); |
| writeln('</h4>'); |
| docCode(type.location, null, showCode: true); |