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 analyzer.src.analysis_options.error.option_codes; | 5 library analyzer.src.analysis_options.error.option_codes; |
6 | 6 |
7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
8 | 8 |
9 /** | 9 /** |
10 * The error codes used for errors in analysis options files. The convention for | 10 * The error codes used for errors in analysis options files. The convention for |
11 * this class is for the name of the error code to indicate the problem that | 11 * this class is for the name of the error code to indicate the problem that |
12 * caused the error to be generated and for the error message to explain what is | 12 * caused the error to be generated and for the error message to explain what is |
13 * wrong and, when appropriate, how the problem can be corrected. | 13 * wrong and, when appropriate, how the problem can be corrected. |
14 */ | 14 */ |
15 class AnalysisOptionsErrorCode extends ErrorCode { | 15 class AnalysisOptionsErrorCode extends ErrorCode { |
16 /** | 16 /** |
17 * An error code indicating that there is a syntactic error in the file. | 17 * An error code indicating that there is a syntactic error in the file. |
18 * | 18 * |
19 * Parameters: | 19 * Parameters: |
20 * 0: the error message from the parse error | 20 * 0: the error message from the parse error |
21 */ | 21 */ |
22 static const AnalysisOptionsErrorCode PARSE_ERROR = | 22 static const AnalysisOptionsErrorCode PARSE_ERROR = |
23 const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}'); | 23 const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}'); |
24 | 24 |
25 /** | 25 /** |
| 26 * An error code indicating that there is a syntactic error |
| 27 * in the included file. |
| 28 * |
| 29 * Parameters: |
| 30 * 0: the path of the file containing the error |
| 31 * 1: the starting offset of the text in the file that contains the error |
| 32 * 2: the ending offset of the text in the file that contains the error |
| 33 * 3: the error message |
| 34 */ |
| 35 static const INCLUDED_FILE_PARSE_ERROR = const AnalysisOptionsErrorCode( |
| 36 'INCLUDED_FILE_PARSE_ERROR', '{3} in {0}({1}..{2})'); |
| 37 |
| 38 /** |
26 * Initialize a newly created error code to have the given [name]. | 39 * Initialize a newly created error code to have the given [name]. |
27 */ | 40 */ |
28 const AnalysisOptionsErrorCode(String name, String message, | 41 const AnalysisOptionsErrorCode(String name, String message, |
29 [String correction]) | 42 [String correction]) |
30 : super(name, message, correction); | 43 : super(name, message, correction); |
31 | 44 |
32 @override | 45 @override |
33 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; | 46 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; |
34 | 47 |
35 @override | 48 @override |
36 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; | 49 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; |
37 } | 50 } |
38 | 51 |
39 /** | 52 /** |
40 * The error codes used for warnings in analysis options files. The convention | 53 * The error codes used for warnings in analysis options files. The convention |
41 * for this class is for the name of the error code to indicate the problem that | 54 * for this class is for the name of the error code to indicate the problem that |
42 * caused the error to be generated and for the error message to explain what is | 55 * caused the error to be generated and for the error message to explain what is |
43 * wrong and, when appropriate, how the problem can be corrected. | 56 * wrong and, when appropriate, how the problem can be corrected. |
44 */ | 57 */ |
45 class AnalysisOptionsWarningCode extends ErrorCode { | 58 class AnalysisOptionsWarningCode extends ErrorCode { |
46 /** | 59 /** |
| 60 * An error code indicating a specified include file could not be found. |
| 61 * |
| 62 * Parameters: |
| 63 * 0: the uri of the file to be included |
| 64 * 1: the path of the file containing the include directive |
| 65 */ |
| 66 static const AnalysisOptionsWarningCode INCLUDE_FILE_NOT_FOUND = |
| 67 const AnalysisOptionsWarningCode('INCLUDE_FILE_NOT_FOUND', |
| 68 "The include file {0} in {1} cannot be found."); |
| 69 |
| 70 /** |
| 71 * An error code indicating a specified include file has a warning. |
| 72 * |
| 73 * Parameters: |
| 74 * 0: the path of the file containing the warnings |
| 75 * 1: the starting offset of the text in the file that contains the warning |
| 76 * 2: the ending offset of the text in the file that contains the warning |
| 77 * 3: the warning message |
| 78 */ |
| 79 static const AnalysisOptionsWarningCode INCLUDED_FILE_WARNING = |
| 80 const AnalysisOptionsWarningCode('INCLUDED_FILE_WARNING', |
| 81 "Warning in the included options file {0}({1}..{2}): {3}"); |
| 82 |
| 83 /** |
47 * An error code indicating that a plugin is being configured with an | 84 * An error code indicating that a plugin is being configured with an |
48 * unsupported option and legal options are provided. | 85 * unsupported option and legal options are provided. |
49 * | 86 * |
50 * Parameters: | 87 * Parameters: |
51 * 0: the plugin name | 88 * 0: the plugin name |
52 * 1: the unsupported option key | 89 * 1: the unsupported option key |
53 * 2: legal values | 90 * 2: legal values |
54 */ | 91 */ |
55 static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES = | 92 static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES = |
56 const AnalysisOptionsWarningCode( | 93 const AnalysisOptionsWarningCode( |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const AnalysisOptionsWarningCode(String name, String message, | 142 const AnalysisOptionsWarningCode(String name, String message, |
106 [String correction]) | 143 [String correction]) |
107 : super(name, message, correction); | 144 : super(name, message, correction); |
108 | 145 |
109 @override | 146 @override |
110 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; | 147 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; |
111 | 148 |
112 @override | 149 @override |
113 ErrorType get type => ErrorType.STATIC_WARNING; | 150 ErrorType get type => ErrorType.STATIC_WARNING; |
114 } | 151 } |
OLD | NEW |