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

Unified Diff: pkg/analysis_server/lib/src/status/get_handler.dart

Issue 1392863003: Add dependency information to the status pages (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/get_handler.dart
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index c85db7b2c21a73d11f4ce5d6fc53cf62d0c5c0b0..c98019077409288daa1bf2146f1caf9ddbe8851b 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -712,30 +712,36 @@ class GetHandler {
buffer.write('<h3>');
buffer.write(HTML_ESCAPE.convert(entry.target.toString()));
buffer.write('</h3>');
- buffer.write('<dl>');
- buffer.write('<dt>time</dt><dd>');
+ buffer.write('<p>time</p><blockquote><p>Value</p><blockquote>');
buffer.write(entry.modificationTime);
- buffer.write('</dd>');
+ buffer.write('</blockquote></blockquote>');
for (ResultDescriptor result in results) {
+ ResultData data = entry.getResultData(result);
CacheState state = entry.getState(result);
String descriptorName = HTML_ESCAPE.convert(result.toString());
String descriptorState = HTML_ESCAPE.convert(state.toString());
- buffer.write('<dt>$descriptorName ($descriptorState)</dt><dd>');
+ buffer
+ .write('<p>$descriptorName ($descriptorState)</p><blockquote>');
if (state == CacheState.VALID) {
+ buffer.write('<p>Value</p><blockquote>');
try {
- _writeValueAsHtml(buffer, entry.getValue(result), linkParameters);
+ _writeValueAsHtml(
+ buffer, entry.getValue(result), linkParameters);
} catch (exception) {
buffer.write('(${HTML_ESCAPE.convert(exception.toString())})');
}
+ buffer.write('</blockquote>');
}
- buffer.write('</dd>');
+ _writeTargetedResults(buffer, 'Depends on', data.dependedOnResults);
+ _writeTargetedResults(
+ buffer, 'Depended on by', data.dependentResults);
+ buffer.write('</blockquote>');
}
if (entry.exception != null) {
buffer.write('<dt>exception</dt><dd>');
_writeException(buffer, entry.exception);
buffer.write('</dd>');
}
- buffer.write('</dl>');
}
});
});
@@ -1753,6 +1759,39 @@ class GetHandler {
}
/**
+ * Write the targeted results returned by iterating over the [results] to the
+ * given [buffer]. The list will have the given [title] written before it.
+ */
+ void _writeTargetedResults(
+ StringBuffer buffer, String title, Iterable<TargetedResult> results) {
+ List<TargetedResult> sortedResults = results.toList();
+ sortedResults.sort((TargetedResult first, TargetedResult second) {
+ int nameOrder =
+ first.result.toString().compareTo(second.result.toString());
+ if (nameOrder != 0) {
+ return nameOrder;
+ }
+ return first.target.toString().compareTo(second.target.toString());
+ });
+
+ buffer.write('<p>');
+ buffer.write(title);
+ buffer.write('</p><blockquote>');
+ if (results.isEmpty) {
+ buffer.write('nothing');
+ } else {
+ for (TargetedResult result in sortedResults) {
+ buffer.write('<p>');
+ buffer.write(result.result.toString());
+ buffer.write(' of ');
+ buffer.write(result.target.toString());
+ buffer.write('<p>');
+ }
+ }
+ buffer.write('</blockquote>');
+ }
+
+ /**
* Write two columns of information to the given [buffer], where the
* [leftColumn] and [rightColumn] functions are used to generate the content
* of those columns.
« 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