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

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

Issue 2879273002: Make server use the common protocol classes (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/analysis_server/tool/spec/spec_input.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
});
}
}
« no previous file with comments | « pkg/analysis_server/tool/spec/spec_input.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698