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

Unified Diff: pkg/dartdoc/dartdoc.dart

Issue 10823390: Full typedef support in dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed null check Created 8 years, 4 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 | pkg/dartdoc/mirrors/dart2js_mirror.dart » ('j') | pkg/dartdoc/mirrors/dart2js_mirror.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | pkg/dartdoc/mirrors/dart2js_mirror.dart » ('j') | pkg/dartdoc/mirrors/dart2js_mirror.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698