OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.src.task.dart; | 5 library analyzer.src.task.dart; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 void internalPerform() { | 2290 void internalPerform() { |
2291 List<List<AnalysisError>> errorLists = <List<AnalysisError>>[]; | 2291 List<List<AnalysisError>> errorLists = <List<AnalysisError>>[]; |
2292 // | 2292 // |
2293 // Prepare inputs. | 2293 // Prepare inputs. |
2294 // | 2294 // |
2295 EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin; | 2295 EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin; |
2296 for (ResultDescriptor result in enginePlugin.dartErrorsForSource) { | 2296 for (ResultDescriptor result in enginePlugin.dartErrorsForSource) { |
2297 String inputName = result.name + '_input'; | 2297 String inputName = result.name + '_input'; |
2298 errorLists.add(getRequiredInput(inputName)); | 2298 errorLists.add(getRequiredInput(inputName)); |
2299 } | 2299 } |
2300 | |
2301 // | |
2302 // Gather error filters. | |
2303 // | |
2304 List<ErrorFilter> filters = | |
2305 context.getConfigurationData(CONFIGURED_ERROR_FILTERS); | |
2306 for (ResultDescriptor result in enginePlugin.dartErrorsForUnit) { | 2300 for (ResultDescriptor result in enginePlugin.dartErrorsForUnit) { |
2307 String inputName = result.name + '_input'; | 2301 String inputName = result.name + '_input'; |
2308 Map<Source, List<AnalysisError>> errorMap = getRequiredInput(inputName); | 2302 Map<Source, List<AnalysisError>> errorMap = getRequiredInput(inputName); |
2309 for (List<AnalysisError> errors in errorMap.values) { | 2303 for (List<AnalysisError> errors in errorMap.values) { |
2310 errorLists.add(errors.where((AnalysisError error) { | 2304 errorLists.add(errors); |
2311 return !filters.any((ErrorFilter filter) => filter(error)); | |
2312 }).toList()); | |
2313 } | 2305 } |
2314 } | 2306 } |
2315 // | 2307 // |
2316 // Record outputs. | 2308 // Record outputs. |
2317 // | 2309 // |
2318 outputs[DART_ERRORS] = AnalysisError.mergeLists(errorLists); | 2310 outputs[DART_ERRORS] = AnalysisError.mergeLists(errorLists); |
2319 } | 2311 } |
2320 | 2312 |
2321 /** | 2313 /** |
2322 * Return a map from the names of the inputs of this kind of task to the task | 2314 * Return a map from the names of the inputs of this kind of task to the task |
(...skipping 2937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5260 | 5252 |
5261 @override | 5253 @override |
5262 bool moveNext() { | 5254 bool moveNext() { |
5263 if (_newSources.isEmpty) { | 5255 if (_newSources.isEmpty) { |
5264 return false; | 5256 return false; |
5265 } | 5257 } |
5266 currentTarget = _newSources.removeLast(); | 5258 currentTarget = _newSources.removeLast(); |
5267 return true; | 5259 return true; |
5268 } | 5260 } |
5269 } | 5261 } |
OLD | NEW |