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

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

Issue 1517723002: Server custom error severity support (#24452). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: lib_renames Created 5 years 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
OLDNEW
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: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:analysis_server/plugin/protocol/protocol.dart' hide Element; 13 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
14 import 'package:analysis_server/src/analysis_server.dart'; 14 import 'package:analysis_server/src/analysis_server.dart';
15 import 'package:analysis_server/src/domain_completion.dart'; 15 import 'package:analysis_server/src/domain_completion.dart';
16 import 'package:analysis_server/src/domain_diagnostic.dart'; 16 import 'package:analysis_server/src/domain_diagnostic.dart';
17 import 'package:analysis_server/src/domain_execution.dart'; 17 import 'package:analysis_server/src/domain_execution.dart';
18 import 'package:analysis_server/src/operation/operation.dart'; 18 import 'package:analysis_server/src/operation/operation.dart';
19 import 'package:analysis_server/src/operation/operation_analysis.dart'; 19 import 'package:analysis_server/src/operation/operation_analysis.dart';
20 import 'package:analysis_server/src/operation/operation_queue.dart'; 20 import 'package:analysis_server/src/operation/operation_queue.dart';
21 import 'package:analysis_server/src/services/index/index.dart'; 21 import 'package:analysis_server/src/services/index/index.dart';
22 import 'package:analysis_server/src/services/index/local_index.dart'; 22 import 'package:analysis_server/src/services/index/local_index.dart';
23 import 'package:analysis_server/src/services/index/store/split_store.dart'; 23 import 'package:analysis_server/src/services/index/store/split_store.dart';
24 import 'package:analysis_server/src/socket_server.dart'; 24 import 'package:analysis_server/src/socket_server.dart';
25 import 'package:analysis_server/src/status/ast_writer.dart'; 25 import 'package:analysis_server/src/status/ast_writer.dart';
26 import 'package:analysis_server/src/status/element_writer.dart'; 26 import 'package:analysis_server/src/status/element_writer.dart';
27 import 'package:analysis_server/src/status/validator.dart'; 27 import 'package:analysis_server/src/status/validator.dart';
28 import 'package:analysis_server/src/utilities/average.dart'; 28 import 'package:analysis_server/src/utilities/average.dart';
29 import 'package:analyzer/file_system/file_system.dart'; 29 import 'package:analyzer/file_system/file_system.dart';
30 import 'package:analyzer/source/error_processor.dart';
30 import 'package:analyzer/src/context/cache.dart'; 31 import 'package:analyzer/src/context/cache.dart';
31 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; 32 import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
32 import 'package:analyzer/src/generated/ast.dart'; 33 import 'package:analyzer/src/generated/ast.dart';
33 import 'package:analyzer/src/generated/element.dart'; 34 import 'package:analyzer/src/generated/element.dart';
34 import 'package:analyzer/src/generated/engine.dart'; 35 import 'package:analyzer/src/generated/engine.dart';
35 import 'package:analyzer/src/generated/error.dart'; 36 import 'package:analyzer/src/generated/error.dart';
36 import 'package:analyzer/src/generated/java_engine.dart'; 37 import 'package:analyzer/src/generated/java_engine.dart';
37 import 'package:analyzer/src/generated/resolver.dart'; 38 import 'package:analyzer/src/generated/resolver.dart';
38 import 'package:analyzer/src/generated/source.dart'; 39 import 'package:analyzer/src/generated/source.dart';
39 import 'package:analyzer/src/generated/utilities_collection.dart'; 40 import 'package:analyzer/src/generated/utilities_collection.dart';
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 if (lints.isEmpty) { 1142 if (lints.isEmpty) {
1142 buffer.write('<p>none</p>'); 1143 buffer.write('<p>none</p>');
1143 } else { 1144 } else {
1144 for (Linter lint in lints) { 1145 for (Linter lint in lints) {
1145 buffer.write('<p>'); 1146 buffer.write('<p>');
1146 buffer.write(lint.runtimeType); 1147 buffer.write(lint.runtimeType);
1147 buffer.write('</p>'); 1148 buffer.write('</p>');
1148 } 1149 }
1149 } 1150 }
1150 1151
1151 List<ErrorFilter> errorFilters = 1152 List<ErrorProcessor> errorProcessors =
1152 context.getConfigurationData(CONFIGURED_ERROR_FILTERS); 1153 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
1153 int filterCount = errorFilters?.length ?? 0; 1154 int processorCount = errorProcessors?.length ?? 0;
1154 buffer.write('<p><b>Error Filter count</b>: $filterCount</p>'); 1155 buffer.write('<p><b>Error Processor count</b>: $processorCount</p>');
1155 }); 1156 });
1156 1157
1157 _writeFiles(buffer, 'Priority Files', priorityNames); 1158 _writeFiles(buffer, 'Priority Files', priorityNames);
1158 _writeFiles(buffer, 'Explicitly Analyzed Files', explicitNames); 1159 _writeFiles(buffer, 'Explicitly Analyzed Files', explicitNames);
1159 _writeFiles(buffer, 'Implicitly Analyzed Files', implicitNames); 1160 _writeFiles(buffer, 'Implicitly Analyzed Files', implicitNames);
1160 1161
1161 buffer.write('<h3>Exceptions</h3>'); 1162 buffer.write('<h3>Exceptions</h3>');
1162 if (exceptions.isEmpty) { 1163 if (exceptions.isEmpty) {
1163 buffer.write('<p>none</p>'); 1164 buffer.write('<p>none</p>');
1164 } else { 1165 } else {
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 */ 2214 */
2214 static String makeLink( 2215 static String makeLink(
2215 String path, Map<String, String> params, String innerHtml, 2216 String path, Map<String, String> params, String innerHtml,
2216 [bool hasError = false]) { 2217 [bool hasError = false]) {
2217 Uri uri = new Uri(path: path, queryParameters: params); 2218 Uri uri = new Uri(path: path, queryParameters: params);
2218 String href = HTML_ESCAPE.convert(uri.toString()); 2219 String href = HTML_ESCAPE.convert(uri.toString());
2219 String classAttribute = hasError ? ' class="error"' : ''; 2220 String classAttribute = hasError ? ' class="error"' : '';
2220 return '<a href="$href"$classAttribute>$innerHtml</a>'; 2221 return '<a href="$href"$classAttribute>$innerHtml</a>';
2221 } 2222 }
2222 } 2223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698