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

Side by Side Diff: pkg/analysis_server/lib/src/status/element_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
« no previous file with comments | « pkg/analysis_server/lib/src/status/ast_writer.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.element_writer; 5 library analysis_server.src.status.element_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/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
10 11
11 /** 12 /**
12 * A visitor that will produce an HTML representation of an element structure. 13 * A visitor that will produce an HTML representation of an element structure.
13 */ 14 */
14 class ElementWriter extends GeneralizingElementVisitor { 15 class ElementWriter extends GeneralizingElementVisitor {
15 /** 16 /**
16 * The buffer on which the HTML is to be written. 17 * The buffer on which the HTML is to be written.
17 */ 18 */
18 final StringBuffer buffer; 19 final StringBuffer buffer;
(...skipping 16 matching lines...) Expand all
35 } 36 }
36 if (element.isSynthetic) { 37 if (element.isSynthetic) {
37 buffer.write('<i>'); 38 buffer.write('<i>');
38 } 39 }
39 buffer.write(HTML_ESCAPE.convert(element.toString())); 40 buffer.write(HTML_ESCAPE.convert(element.toString()));
40 if (element.isSynthetic) { 41 if (element.isSynthetic) {
41 buffer.write('</i>'); 42 buffer.write('</i>');
42 } 43 }
43 buffer.write(' <span style="color:gray">('); 44 buffer.write(' <span style="color:gray">(');
44 buffer.write(element.runtimeType); 45 buffer.write(element.runtimeType);
45 buffer.write(')</span><br>'); 46 buffer.write(')</span>');
47 if (element is! LibraryElement) {
48 String name = element.name;
49 if (name != null) {
50 buffer.write('&nbsp;&nbsp;[');
51 buffer.write(GetHandler.makeLink(GetHandler.INDEX_ELEMENT_BY_NAME, {
52 'name': name
53 }, 'search index'));
54 buffer.write(']');
55 }
56 }
57 buffer.write('<br>');
46 indentLevel++; 58 indentLevel++;
47 try { 59 try {
48 element.visitChildren(this); 60 element.visitChildren(this);
49 } finally { 61 } finally {
50 indentLevel--; 62 indentLevel--;
51 } 63 }
52 } 64 }
53 } 65 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/status/ast_writer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698