OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.get_handler; | 5 library analysis_server.src.get_handler; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
11 import 'dart:math'; | 11 import 'dart:math'; |
12 | 12 |
13 import 'package:analyzer/plugin/plugin.dart'; | |
14 import 'package:analysis_server/src/analysis_server.dart'; | 13 import 'package:analysis_server/src/analysis_server.dart'; |
15 import 'package:analysis_server/src/domain_completion.dart'; | 14 import 'package:analysis_server/src/domain_completion.dart'; |
16 import 'package:analysis_server/src/domain_execution.dart'; | 15 import 'package:analysis_server/src/domain_execution.dart'; |
17 import 'package:analysis_server/src/operation/operation.dart'; | 16 import 'package:analysis_server/src/operation/operation.dart'; |
18 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 17 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
19 import 'package:analysis_server/src/operation/operation_queue.dart'; | 18 import 'package:analysis_server/src/operation/operation_queue.dart'; |
20 import 'package:analysis_server/src/protocol.dart' hide Element; | 19 import 'package:analysis_server/src/protocol.dart' hide Element; |
21 import 'package:analysis_server/src/services/index/index.dart'; | 20 import 'package:analysis_server/src/services/index/index.dart'; |
22 import 'package:analysis_server/src/services/index/local_index.dart'; | 21 import 'package:analysis_server/src/services/index/local_index.dart'; |
23 import 'package:analysis_server/src/services/index/store/split_store.dart'; | 22 import 'package:analysis_server/src/services/index/store/split_store.dart'; |
24 import 'package:analysis_server/src/socket_server.dart'; | 23 import 'package:analysis_server/src/socket_server.dart'; |
25 import 'package:analysis_server/src/status/ast_writer.dart'; | 24 import 'package:analysis_server/src/status/ast_writer.dart'; |
26 import 'package:analysis_server/src/status/element_writer.dart'; | 25 import 'package:analysis_server/src/status/element_writer.dart'; |
27 import 'package:analyzer/file_system/file_system.dart'; | 26 import 'package:analyzer/file_system/file_system.dart'; |
28 import 'package:analyzer/src/generated/ast.dart'; | 27 import 'package:analyzer/src/generated/ast.dart'; |
29 import 'package:analyzer/src/generated/element.dart'; | 28 import 'package:analyzer/src/generated/element.dart'; |
30 import 'package:analyzer/src/generated/engine.dart'; | 29 import 'package:analyzer/src/generated/engine.dart'; |
31 import 'package:analyzer/src/generated/java_engine.dart'; | 30 import 'package:analyzer/src/generated/java_engine.dart'; |
32 import 'package:analyzer/src/generated/source.dart'; | 31 import 'package:analyzer/src/generated/source.dart'; |
33 import 'package:analyzer/src/generated/utilities_general.dart'; | 32 import 'package:analyzer/src/generated/utilities_general.dart'; |
34 | 33 import 'package:plugin/plugin.dart'; |
35 import 'analysis_server.dart'; | |
36 | 34 |
37 /** | 35 /** |
38 * A function that can be used to generate HTML output into the given [buffer]. | 36 * A function that can be used to generate HTML output into the given [buffer]. |
39 * The HTML that is generated must be valid (special characters must already be | 37 * The HTML that is generated must be valid (special characters must already be |
40 * encoded). | 38 * encoded). |
41 */ | 39 */ |
42 typedef void HtmlGenerator(StringBuffer buffer); | 40 typedef void HtmlGenerator(StringBuffer buffer); |
43 | 41 |
44 /** | 42 /** |
45 * Instances of the class [GetHandler] handle GET requests. | 43 * Instances of the class [GetHandler] handle GET requests. |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 */ | 1578 */ |
1581 static String makeLink( | 1579 static String makeLink( |
1582 String path, Map<String, String> params, String innerHtml, | 1580 String path, Map<String, String> params, String innerHtml, |
1583 [bool hasError = false]) { | 1581 [bool hasError = false]) { |
1584 Uri uri = new Uri(path: path, queryParameters: params); | 1582 Uri uri = new Uri(path: path, queryParameters: params); |
1585 String href = HTML_ESCAPE.convert(uri.toString()); | 1583 String href = HTML_ESCAPE.convert(uri.toString()); |
1586 String classAttribute = hasError ? ' class="error"' : ''; | 1584 String classAttribute = hasError ? ' class="error"' : ''; |
1587 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 1585 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
1588 } | 1586 } |
1589 } | 1587 } |
OLD | NEW |