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

Side by Side Diff: pkg/analysis_server/lib/src/status/ast_writer.dart

Issue 910293002: Add index search support to AST and element model pages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis_server.src.status.ast_writer; 5 library analysis_server.src.status.ast_writer;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analysis_server/src/get_handler.dart';
9 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
11 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/java_engine.dart'; 12 import 'package:analyzer/src/generated/java_engine.dart';
11 13
12 /** 14 /**
13 * A visitor that will produce an HTML representation of an AST structure. 15 * A visitor that will produce an HTML representation of an AST structure.
14 */ 16 */
15 class AstWriter extends UnifyingAstVisitor { 17 class AstWriter extends UnifyingAstVisitor {
16 /** 18 /**
17 * The buffer on which the HTML is to be written. 19 * The buffer on which the HTML is to be written.
18 */ 20 */
19 final StringBuffer buffer; 21 final StringBuffer buffer;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 exceptions.add(new CaughtException(exception, stackTrace)); 190 exceptions.add(new CaughtException(exception, stackTrace));
189 } 191 }
190 _indent(2); 192 _indent(2);
191 buffer.write('$name = '); 193 buffer.write('$name = ');
192 if (valueString == null) { 194 if (valueString == null) {
193 buffer.write('<span style="color: #FF0000">'); 195 buffer.write('<span style="color: #FF0000">');
194 buffer.write(HTML_ESCAPE.convert(value.runtimeType.toString())); 196 buffer.write(HTML_ESCAPE.convert(value.runtimeType.toString()));
195 buffer.write('</span>'); 197 buffer.write('</span>');
196 } else { 198 } else {
197 buffer.write(HTML_ESCAPE.convert(valueString)); 199 buffer.write(HTML_ESCAPE.convert(valueString));
200 if (value is Element && value is! LibraryElement) {
201 String name = value.name;
202 if (name != null) {
203 buffer.write('&nbsp;&nbsp;[');
204 buffer.write(GetHandler.makeLink(GetHandler.INDEX_ELEMENT_BY_NAME, {
205 'name': name
206 }, 'search index'));
207 buffer.write(']');
208 }
209 }
198 } 210 }
199 buffer.write('<br>'); 211 buffer.write('<br>');
200 } 212 }
201 } 213 }
202 } 214 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/get_handler.dart ('k') | pkg/analysis_server/lib/src/status/element_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698