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 engine.error; | 5 library engine.error; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
| 9 import 'package:analyzer/src/task/model.dart'; |
| 10 import 'package:analyzer/task/model.dart'; |
9 import 'package:source_span/source_span.dart'; | 11 import 'package:source_span/source_span.dart'; |
10 | 12 |
11 import 'ast.dart' show AstNode; | 13 import 'ast.dart' show AstNode; |
12 import 'element.dart'; | 14 import 'element.dart'; |
13 import 'java_core.dart'; | 15 import 'java_core.dart'; |
14 import 'scanner.dart' show Token; | 16 import 'scanner.dart' show Token; |
15 import 'source.dart'; | 17 import 'source.dart'; |
16 | 18 |
17 /** | 19 /** |
| 20 * The descriptor used to associate error filters with analysis contexts in |
| 21 * configuration data. |
| 22 */ |
| 23 final ListResultDescriptor<List<ErrorFilter>> CONFIGURED_ERROR_FILTERS = |
| 24 new ListResultDescriptorImpl('configured.errors', const <ErrorFilter>[]); |
| 25 |
| 26 /** |
| 27 * A predicate used to potentially filter an [error]. |
| 28 * |
| 29 * Returns `true` if this error should be filtered from analysis results. |
| 30 */ |
| 31 typedef bool ErrorFilter(AnalysisError error); |
| 32 |
| 33 /** |
18 * An error discovered during the analysis of some Dart code. | 34 * An error discovered during the analysis of some Dart code. |
19 * | 35 * |
20 * See [AnalysisErrorListener]. | 36 * See [AnalysisErrorListener]. |
21 */ | 37 */ |
22 class AnalysisError { | 38 class AnalysisError { |
23 /** | 39 /** |
24 * An empty array of errors used when no errors are expected. | 40 * An empty array of errors used when no errors are expected. |
25 */ | 41 */ |
26 static const List<AnalysisError> NO_ERRORS = const <AnalysisError>[]; | 42 static const List<AnalysisError> NO_ERRORS = const <AnalysisError>[]; |
27 | 43 |
(...skipping 5053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5081 * Initialize a newly created error code to have the given [name]. | 5097 * Initialize a newly created error code to have the given [name]. |
5082 */ | 5098 */ |
5083 const TodoCode(String name) : super(name, "{0}"); | 5099 const TodoCode(String name) : super(name, "{0}"); |
5084 | 5100 |
5085 @override | 5101 @override |
5086 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5102 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
5087 | 5103 |
5088 @override | 5104 @override |
5089 ErrorType get type => ErrorType.TODO; | 5105 ErrorType get type => ErrorType.TODO; |
5090 } | 5106 } |
OLD | NEW |