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.status.get_handler; | 5 library analysis_server.src.status.get_handler; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:math'; | 10 import 'dart:math'; |
(...skipping 28 matching lines...) Expand all Loading... |
39 import 'package:analyzer/src/generated/resolver.dart'; | 39 import 'package:analyzer/src/generated/resolver.dart'; |
40 import 'package:analyzer/src/generated/sdk.dart'; | 40 import 'package:analyzer/src/generated/sdk.dart'; |
41 import 'package:analyzer/src/generated/source.dart'; | 41 import 'package:analyzer/src/generated/source.dart'; |
42 import 'package:analyzer/src/generated/utilities_collection.dart'; | 42 import 'package:analyzer/src/generated/utilities_collection.dart'; |
43 import 'package:analyzer/src/generated/utilities_general.dart'; | 43 import 'package:analyzer/src/generated/utilities_general.dart'; |
44 import 'package:analyzer/src/services/lint.dart'; | 44 import 'package:analyzer/src/services/lint.dart'; |
45 import 'package:analyzer/src/task/dart.dart'; | 45 import 'package:analyzer/src/task/dart.dart'; |
46 import 'package:analyzer/src/task/driver.dart'; | 46 import 'package:analyzer/src/task/driver.dart'; |
47 import 'package:analyzer/src/task/html.dart'; | 47 import 'package:analyzer/src/task/html.dart'; |
48 import 'package:analyzer/src/task/options.dart'; | 48 import 'package:analyzer/src/task/options.dart'; |
49 import 'package:analyzer/src/task/options.dart' | |
50 show CONFIGURED_ERROR_PROCESSORS; | |
51 import 'package:analyzer/task/dart.dart'; | 49 import 'package:analyzer/task/dart.dart'; |
52 import 'package:analyzer/task/general.dart'; | 50 import 'package:analyzer/task/general.dart'; |
53 import 'package:analyzer/task/html.dart'; | 51 import 'package:analyzer/task/html.dart'; |
54 import 'package:analyzer/task/model.dart'; | 52 import 'package:analyzer/task/model.dart'; |
55 import 'package:plugin/plugin.dart'; | 53 import 'package:plugin/plugin.dart'; |
56 | 54 |
57 /** | 55 /** |
58 * A function that can be used to generate HTML output into the given [buffer]. | 56 * A function that can be used to generate HTML output into the given [buffer]. |
59 * The HTML that is generated must be valid (special characters must already be | 57 * The HTML that is generated must be valid (special characters must already be |
60 * encoded). | 58 * encoded). |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 buffer.write('<p><b>SDK Context Options</b></p>'); | 1441 buffer.write('<p><b>SDK Context Options</b></p>'); |
1444 DartSdk sdk = context?.sourceFactory?.dartSdk; | 1442 DartSdk sdk = context?.sourceFactory?.dartSdk; |
1445 writeOptions(buffer, sdk?.context?.analysisOptions, | 1443 writeOptions(buffer, sdk?.context?.analysisOptions, |
1446 writeAdditionalOptions: (StringBuffer buffer) { | 1444 writeAdditionalOptions: (StringBuffer buffer) { |
1447 if (sdk is FolderBasedDartSdk) { | 1445 if (sdk is FolderBasedDartSdk) { |
1448 _writeOption(buffer, 'Use summaries', sdk.useSummary); | 1446 _writeOption(buffer, 'Use summaries', sdk.useSummary); |
1449 } | 1447 } |
1450 }); | 1448 }); |
1451 }, | 1449 }, |
1452 (StringBuffer buffer) { | 1450 (StringBuffer buffer) { |
1453 List<Linter> lints = | 1451 List<Linter> lints = context.analysisOptions.lintRules; |
1454 context.getConfigurationData(CONFIGURED_LINTS_KEY); | |
1455 buffer.write('<p><b>Lints</b></p>'); | 1452 buffer.write('<p><b>Lints</b></p>'); |
1456 if (lints.isEmpty) { | 1453 if (lints.isEmpty) { |
1457 buffer.write('<p>none</p>'); | 1454 buffer.write('<p>none</p>'); |
1458 } else { | 1455 } else { |
1459 for (Linter lint in lints) { | 1456 for (Linter lint in lints) { |
1460 buffer.write('<p>'); | 1457 buffer.write('<p>'); |
1461 buffer.write(lint.runtimeType); | 1458 buffer.write(lint.runtimeType); |
1462 buffer.write('</p>'); | 1459 buffer.write('</p>'); |
1463 } | 1460 } |
1464 } | 1461 } |
1465 | 1462 |
1466 List<ErrorProcessor> errorProcessors = | 1463 List<ErrorProcessor> errorProcessors = |
1467 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); | 1464 context.analysisOptions.errorProcessors; |
1468 int processorCount = errorProcessors?.length ?? 0; | 1465 int processorCount = errorProcessors?.length ?? 0; |
1469 buffer | 1466 buffer |
1470 .write('<p><b>Error Processor count</b>: $processorCount</p>'); | 1467 .write('<p><b>Error Processor count</b>: $processorCount</p>'); |
1471 } | 1468 } |
1472 ]); | 1469 ]); |
1473 | 1470 |
1474 SourceFactory sourceFactory = context.sourceFactory; | 1471 SourceFactory sourceFactory = context.sourceFactory; |
1475 if (sourceFactory is SourceFactoryImpl) { | 1472 if (sourceFactory is SourceFactoryImpl) { |
1476 buffer.write('<h3>Resolvers</h3>'); | 1473 buffer.write('<h3>Resolvers</h3>'); |
1477 for (UriResolver resolver in sourceFactory.resolvers) { | 1474 for (UriResolver resolver in sourceFactory.resolvers) { |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2734 */ | 2731 */ |
2735 static String makeLink( | 2732 static String makeLink( |
2736 String path, Map<String, String> params, String innerHtml, | 2733 String path, Map<String, String> params, String innerHtml, |
2737 [bool hasError = false]) { | 2734 [bool hasError = false]) { |
2738 Uri uri = new Uri(path: path, queryParameters: params); | 2735 Uri uri = new Uri(path: path, queryParameters: params); |
2739 String href = HTML_ESCAPE.convert(uri.toString()); | 2736 String href = HTML_ESCAPE.convert(uri.toString()); |
2740 String classAttribute = hasError ? ' class="error"' : ''; | 2737 String classAttribute = hasError ? ' class="error"' : ''; |
2741 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 2738 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
2742 } | 2739 } |
2743 } | 2740 } |
OLD | NEW |