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

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 68363003: Make subclasses in packages have the right link. Sort by name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index ddb3cce1fb82b81923f41c1e0cb374026e1fbec4..da6fe2539d346d30921f58cea779491d29e40d40 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -904,13 +904,13 @@ class Library extends Indexable {
}
/// A class containing contents of a Dart class.
-class Class extends Indexable {
+class Class extends Indexable implements Comparable {
/// List of the names of interfaces that this class implements.
List<Class> interfaces = [];
/// Names of classes that extends or implements this class.
- Set<String> subclasses = new Set<String>();
+ Set<Class> subclasses = new Set<Class>();
/// Top-level variables in the class.
Map<String, Variable> variables;
@@ -969,7 +969,7 @@ class Class extends Indexable {
interface.addSubclass(subclass);
});
} else {
- subclasses.add(subclass.qualifiedName);
+ subclasses.add(subclass);
}
}
@@ -998,7 +998,7 @@ class Class extends Indexable {
entityMap.values.where((e) => e.owner == qualifiedName)
.forEach((element) => element.isPrivate = true);
// Move the subclass up to the next public superclass
- subclasses.forEach((subclass) => addSubclass(entityMap[subclass]));
+ subclasses.forEach((subclass) => addSubclass(subclass));
}
}
@@ -1027,7 +1027,8 @@ class Class extends Indexable {
'superclass': validSuperclass(),
'implements': interfaces.where(_isVisible)
.map((e) => e.qualifiedName).toList(),
- 'subclass': subclasses.toList(),
+ 'subclass': (subclasses.toList()..sort())
+ .map((x) => x.qualifiedName).toList(),
'variables': recurseMap(variables),
'inheritedVariables': recurseMap(inheritedVariables),
'methods': methods.toMap(),
@@ -1035,6 +1036,8 @@ class Class extends Indexable {
'annotations': annotations.map((a) => a.toMap()).toList(),
'generics': recurseMap(generics)
};
+
+ int compareTo(aClass) => name.compareTo(aClass.name);
}
/// A container to categorize classes into the following groups: abstract
« 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