OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:math'; | 7 import 'dart:math'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 request, 'Query parameter $CONTEXT_QUERY_PARAM required'); | 376 request, 'Query parameter $CONTEXT_QUERY_PARAM required'); |
377 } | 377 } |
378 AnalysisDriver driver = null; | 378 AnalysisDriver driver = null; |
379 Folder folder = _findFolder(analysisServer, contextFilter); | 379 Folder folder = _findFolder(analysisServer, contextFilter); |
380 if (folder == null) { | 380 if (folder == null) { |
381 return _returnFailure(request, 'Invalid context: $contextFilter'); | 381 return _returnFailure(request, 'Invalid context: $contextFilter'); |
382 } else { | 382 } else { |
383 driver = analysisServer.driverMap[folder]; | 383 driver = analysisServer.driverMap[folder]; |
384 } | 384 } |
385 | 385 |
386 // TODO(scheglov) Show priority files. | 386 List<String> priorityFiles = driver.priorityFiles; |
387 // List<String> priorityNames = <String>[]; | |
388 List<String> addedFiles = driver.addedFiles.toList(); | 387 List<String> addedFiles = driver.addedFiles.toList(); |
389 List<String> implicitFiles = | 388 List<String> implicitFiles = |
390 driver.knownFiles.difference(driver.addedFiles).toList(); | 389 driver.knownFiles.difference(driver.addedFiles).toList(); |
391 addedFiles.sort(); | 390 addedFiles.sort(); |
392 implicitFiles.sort(); | 391 implicitFiles.sort(); |
393 | 392 |
394 // TODO(scheglov) Use file overlays. | 393 // TODO(scheglov) Use file overlays. |
395 // _overlayContents.clear(); | 394 // _overlayContents.clear(); |
396 // context.visitContentCache((String fullName, int stamp, String contents) { | 395 // context.visitContentCache((String fullName, int stamp, String contents) { |
397 // _overlayContents[fullName] = contents; | 396 // _overlayContents[fullName] = contents; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 buffer.write(')'); | 509 buffer.write(')'); |
511 } else if (resolver is SdkExtUriResolver) { | 510 } else if (resolver is SdkExtUriResolver) { |
512 buffer.write(' (map = '); | 511 buffer.write(' (map = '); |
513 _writeMapOfStringToString(buffer, resolver.urlMappings); | 512 _writeMapOfStringToString(buffer, resolver.urlMappings); |
514 buffer.write(')'); | 513 buffer.write(')'); |
515 } | 514 } |
516 buffer.write('</p>'); | 515 buffer.write('</p>'); |
517 } | 516 } |
518 } | 517 } |
519 | 518 |
520 // TODO(scheglov) Show priority files. | 519 _writeFiles( |
521 // _writeFiles( | 520 buffer, 'Priority Files (${priorityFiles.length})', priorityFiles); |
522 // buffer, 'Priority Files (${priorityNames.length})', priorityNames)
; | |
523 _writeFiles(buffer, 'Added Files (${addedFiles.length})', addedFiles); | 521 _writeFiles(buffer, 'Added Files (${addedFiles.length})', addedFiles); |
524 _writeFiles( | 522 _writeFiles( |
525 buffer, | 523 buffer, |
526 'Implicitly Analyzed Files (${implicitFiles.length})', | 524 'Implicitly Analyzed Files (${implicitFiles.length})', |
527 implicitFiles); | 525 implicitFiles); |
528 | 526 |
529 // TODO(scheglov) Show exceptions. | 527 // TODO(scheglov) Show exceptions. |
530 // buffer.write('<h3>Exceptions</h3>'); | 528 // buffer.write('<h3>Exceptions</h3>'); |
531 // if (exceptions.isEmpty) { | 529 // if (exceptions.isEmpty) { |
532 // buffer.write('<p>none</p>'); | 530 // buffer.write('<p>none</p>'); |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 String path, Map<String, String> params, String innerHtml, | 1231 String path, Map<String, String> params, String innerHtml, |
1234 [bool hasError = false]) { | 1232 [bool hasError = false]) { |
1235 Uri uri = params.isEmpty | 1233 Uri uri = params.isEmpty |
1236 ? new Uri(path: path) | 1234 ? new Uri(path: path) |
1237 : new Uri(path: path, queryParameters: params); | 1235 : new Uri(path: path, queryParameters: params); |
1238 String href = HTML_ESCAPE.convert(uri.toString()); | 1236 String href = HTML_ESCAPE.convert(uri.toString()); |
1239 String classAttribute = hasError ? ' class="error"' : ''; | 1237 String classAttribute = hasError ? ' class="error"' : ''; |
1240 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 1238 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
1241 } | 1239 } |
1242 } | 1240 } |
OLD | NEW |