Index: pkg/analysis_server/tool/spec/to_html.dart |
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart |
index dc8f3e3f2baa1351d7140f9a5ab2a7f064f7cead..d9e01f46829b2adae800c28b43d277eaa1796f78 100644 |
--- a/pkg/analysis_server/tool/spec/to_html.dart |
+++ b/pkg/analysis_server/tool/spec/to_html.dart |
@@ -7,8 +7,6 @@ |
* full description of the API as a web page, and for generating doc comments |
* in generated code. |
*/ |
-library to.html; |
- |
import 'dart:convert'; |
import 'package:analyzer/src/codegen/html.dart'; |
@@ -208,11 +206,11 @@ abstract class HtmlMixin { |
void p(void callback()) => element('p', {}, callback); |
void pre(void callback()) => element('pre', {}, callback); |
+ void span(String cls, void callback()) => |
+ element('span', {'class': cls}, callback); |
void title(void callback()) => element('title', {}, callback); |
void tt(void callback()) => element('tt', {}, callback); |
void ul(void callback()) => element('ul', {}, callback); |
- void span(String cls, void callback()) => |
- element('span', {'class': cls}, callback); |
} |
/** |
@@ -279,6 +277,12 @@ class ToHtmlVisitor extends HierarchicalApiVisitor |
} |
} |
+ void generateDomainsHeader() { |
+ h1(() { |
+ write('Domains'); |
+ }); |
+ } |
+ |
void generateIndex() { |
h3(() => write('Domains')); |
for (var domain in api.domains) { |
@@ -309,6 +313,9 @@ class ToHtmlVisitor extends HierarchicalApiVisitor |
} |
void generateRefactoringsIndex(Iterable<Refactoring> refactorings) { |
+ if (refactorings == null) { |
+ return; |
+ } |
h3(() { |
write("Refactorings"); |
write(' ('); |
@@ -344,12 +351,6 @@ class ToHtmlVisitor extends HierarchicalApiVisitor |
}); |
} |
- void generateDomainsHeader() { |
- h1(() { |
- write('Domains'); |
- }); |
- } |
- |
void generateTableOfContents() { |
for (var domain in api.domains.where((domain) => !domain.experimental)) { |
writeln(); |
@@ -382,9 +383,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))); |
} |
}); |
@@ -478,7 +481,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); |
}); |
@@ -694,7 +697,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); |
}); |
} |
} |