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 protocol.server; | 5 library protocol.server; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; | 8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; |
9 import 'package:analysis_server/src/services/correction/fix.dart'; | 9 import 'package:analysis_server/src/services/correction/fix.dart'; |
10 import 'package:analysis_server/src/services/search/search_engine.dart' | 10 import 'package:analysis_server/src/services/search/search_engine.dart' |
(...skipping 12 matching lines...) Expand all Loading... |
23 import 'package:analyzer/src/generated/utilities_dart.dart' as engine; | 23 import 'package:analyzer/src/generated/utilities_dart.dart' as engine; |
24 | 24 |
25 export 'package:analysis_server/plugin/protocol/protocol.dart'; | 25 export 'package:analysis_server/plugin/protocol/protocol.dart'; |
26 export 'package:analysis_server/plugin/protocol/protocol_dart.dart'; | 26 export 'package:analysis_server/plugin/protocol/protocol_dart.dart'; |
27 | 27 |
28 /** | 28 /** |
29 * Returns a list of AnalysisErrors corresponding to the given list of Engine | 29 * Returns a list of AnalysisErrors corresponding to the given list of Engine |
30 * errors. | 30 * errors. |
31 */ | 31 */ |
32 List<AnalysisError> doAnalysisError_listFromEngine( | 32 List<AnalysisError> doAnalysisError_listFromEngine( |
33 engine.AnalysisContext context, | 33 engine.AnalysisOptions analysisOptions, |
34 engine.LineInfo lineInfo, | 34 engine.LineInfo lineInfo, |
35 List<engine.AnalysisError> errors) { | 35 List<engine.AnalysisError> errors) { |
36 List<AnalysisError> serverErrors = <AnalysisError>[]; | 36 List<AnalysisError> serverErrors = <AnalysisError>[]; |
37 for (engine.AnalysisError error in errors) { | 37 for (engine.AnalysisError error in errors) { |
38 ErrorProcessor processor = ErrorProcessor.getProcessor(context, error); | 38 ErrorProcessor processor = |
| 39 ErrorProcessor.getProcessor(analysisOptions, error); |
39 if (processor != null) { | 40 if (processor != null) { |
40 engine.ErrorSeverity severity = processor.severity; | 41 engine.ErrorSeverity severity = processor.severity; |
41 // Errors with null severity are filtered out. | 42 // Errors with null severity are filtered out. |
42 if (severity != null) { | 43 if (severity != null) { |
43 // Specified severities override. | 44 // Specified severities override. |
44 serverErrors | 45 serverErrors |
45 .add(newAnalysisError_fromEngine(lineInfo, error, severity)); | 46 .add(newAnalysisError_fromEngine(lineInfo, error, severity)); |
46 } | 47 } |
47 } else { | 48 } else { |
48 serverErrors.add(newAnalysisError_fromEngine(lineInfo, error)); | 49 serverErrors.add(newAnalysisError_fromEngine(lineInfo, error)); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 if (lineInfo != null) { | 262 if (lineInfo != null) { |
262 engine.LineInfo_Location offsetLocation = | 263 engine.LineInfo_Location offsetLocation = |
263 lineInfo.getLocation(range.offset); | 264 lineInfo.getLocation(range.offset); |
264 startLine = offsetLocation.lineNumber; | 265 startLine = offsetLocation.lineNumber; |
265 startColumn = offsetLocation.columnNumber; | 266 startColumn = offsetLocation.columnNumber; |
266 } | 267 } |
267 } on AnalysisException {} | 268 } on AnalysisException {} |
268 return new Location( | 269 return new Location( |
269 source.fullName, range.offset, range.length, startLine, startColumn); | 270 source.fullName, range.offset, range.length, startLine, startColumn); |
270 } | 271 } |
OLD | NEW |