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

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: Updated cf. comments. 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') | no next file with comments »
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..f2079785b86863c7fa6cec2d84516553b600f591 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,18 @@ class Dartdoc {
exceptions.add(type);
} else if (type.isClass) {
classes.add(type);
- } else {
+ } else if (type.isInterface){
interfaces.add(type);
+ } else if (type is TypedefMirror) {
+ typedefs.add(type);
+ } else {
+ throw new InternalError("internal error: unknown type $type.");
}
}
docTypes(classes, 'Classes');
docTypes(interfaces, 'Interfaces');
+ docTypes(typedefs, 'Typedefs');
docTypes(exceptions, 'Exceptions');
writeFooter();
@@ -807,7 +813,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 +995,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698