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

Unified Diff: utils/dartdoc/dartdoc.dart

Issue 8885005: In the navigation, list exception types after other types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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: utils/dartdoc/dartdoc.dart
diff --git a/utils/dartdoc/dartdoc.dart b/utils/dartdoc/dartdoc.dart
index 18b15bdfb2c0f3bc4af0cd150b6f464ba483fcba..e11db2fe208959e354eb896dd5648f324c4c0926 100644
--- a/utils/dartdoc/dartdoc.dart
+++ b/utils/dartdoc/dartdoc.dart
@@ -248,29 +248,39 @@ docNavigation() {
/** Writes the navigation for the types contained by the given library. */
docLibraryNavigation(Library library) {
- final types = orderByName(library.types).filter(
- (type) => !type.isTop && !type.name.startsWith('_'));
+ // Show the exception types separately.
+ final types = <Type>[];
+ final exceptions = <Type>[];
- if (types.length == 0) return;
+ for (final type in orderByName(library.types)) {
+ if (type.isTop) continue;
+ if (type.name.startsWith('_')) continue;
- writeln('<ul>');
- for (final type in types) {
- var icon = 'icon-interface';
if (type.name.endsWith('Exception')) {
- icon = 'icon-exception';
- } else if (type.isClass) {
- icon = 'icon-class';
+ exceptions.add(type);
+ } else {
+ types.add(type);
}
- write('<li>');
+ }
+
+ if ((types.length == 0) && (exceptions.length == 0)) return;
+ writeType(String icon, Type type) {
+ write('<li>');
if (_currentType == type) {
- write('<div class="$icon"></div><strong>${typeName(type)}</strong>');
+ write(
+ '<div class="icon-$icon"></div><strong>${typeName(type)}</strong>');
} else {
- write(a(typeUrl(type), '<div class="$icon"></div>${typeName(type)}'));
+ write(a(typeUrl(type),
+ '<div class="icon-$icon"></div>${typeName(type)}'));
}
-
writeln('</li>');
}
+
+ writeln('<ul>');
+ types.forEach((type) => writeType(type.isClass ? 'class' : 'interface',
+ type));
+ exceptions.forEach((type) => writeType('exception', type));
writeln('</ul>');
}
« 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