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

Unified Diff: pkg/analyzer_plugin/tool/spec/to_html.dart

Issue 2876023003: Allow the common spec types to be in a separate document (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/analyzer_plugin/tool/spec/plugin_spec.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/tool/spec/to_html.dart
diff --git a/pkg/analyzer_plugin/tool/spec/to_html.dart b/pkg/analyzer_plugin/tool/spec/to_html.dart
index b5096d1d64f845aaa4b4084e2da192730eea6aae..f71f98cc6d596327c385e7d0a6908ad5bc158811 100644
--- a/pkg/analyzer_plugin/tool/spec/to_html.dart
+++ b/pkg/analyzer_plugin/tool/spec/to_html.dart
@@ -344,9 +344,11 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
link('types', () => write('\u2191'));
write(')');
});
+ List<String> sortedTypes = types.toList();
+ sortedTypes.sort();
element('div', {'class': 'subindex'}, () {
element('ul', {}, () {
- for (var type in types) {
+ for (var type in sortedTypes) {
element('li', {}, () => link('type_$type', () => write(type)));
}
});
@@ -434,7 +436,7 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
generateIndex();
break;
default:
- if (!specialElements.contains(node.localName)) {
+ if (!ApiReader.specialElements.contains(node.localName)) {
element(node.localName, node.attributes, () {
translateHtml(node, squashParagraphs: squashParagraphs);
});
@@ -655,7 +657,10 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
void visitTypes(Types types) {
translateHtml(types.html);
dl(() {
- super.visitTypes(types);
+ List<TypeDefinition> sortedTypes = types.toList();
+ sortedTypes.sort((TypeDefinition first, TypeDefinition second) =>
+ first.name.compareTo(second.name));
+ sortedTypes.forEach(visitTypeDefinition);
});
}
}
« no previous file with comments | « pkg/analyzer_plugin/tool/spec/plugin_spec.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698