Skip to content

Commit d09a936

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer/linter] Document message parameter names and types.
The code generation for diagnostic codes is changed so that parameter names and their types show up in the auto-generated doc comments. When we begin the transition to reporting diagnostics using a statically-checked API, these comments should make it easier to figure out what parameters to pass in. Change-Id: I6b33ccd5b5d5a24001da2e1af2cd31cc30366e6a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444365 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 8928283 commit d09a936

File tree

10 files changed

+904
-868
lines changed

10 files changed

+904
-868
lines changed

pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ import "package:_fe_analyzer_shared/src/base/errors.dart";
2828

2929
class ScannerErrorCode extends DiagnosticCode {
3030
/// Parameters:
31-
/// 0: the token that was expected but not found
31+
/// String p0: the token that was expected but not found
3232
static const ScannerErrorCode EXPECTED_TOKEN = const ScannerErrorCode(
3333
'EXPECTED_TOKEN',
3434
"Expected to find '{0}'.",
3535
);
3636

3737
/// Parameters:
38-
/// 0: the illegal character
38+
/// Object p0: the illegal character
3939
static const ScannerErrorCode ILLEGAL_CHARACTER = const ScannerErrorCode(
4040
'ILLEGAL_CHARACTER',
4141
"Illegal character '{0}'.",
@@ -66,7 +66,7 @@ class ScannerErrorCode extends DiagnosticCode {
6666
);
6767

6868
/// Parameters:
69-
/// 0: the path of the file that cannot be read
69+
/// Object p0: the path of the file that cannot be read
7070
static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode(
7171
'UNABLE_GET_CONTENT',
7272
"Unable to get content of '{0}'.",
@@ -91,7 +91,7 @@ class ScannerErrorCode extends DiagnosticCode {
9191
);
9292

9393
/// Parameters:
94-
/// 0: the unsupported operator
94+
/// String p0: the unsupported operator
9595
static const ScannerErrorCode UNSUPPORTED_OPERATOR = const ScannerErrorCode(
9696
'UNSUPPORTED_OPERATOR',
9797
"The '{0}' operator is not supported.",

pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ class AnalysisOptionsErrorCode extends DiagnosticCode {
3131
/// file.
3232
///
3333
/// Parameters:
34-
/// 0: the path of the file containing the error
35-
/// 1: the starting offset of the text in the file that contains the error
36-
/// 2: the ending offset of the text in the file that contains the error
37-
/// 3: the error message
34+
/// Object p0: the path of the file containing the error
35+
/// Object p1: the starting offset of the text in the file that contains the
36+
/// error
37+
/// Object p2: the ending offset of the text in the file that contains the
38+
/// error
39+
/// Object p3: the error message
3840
static const AnalysisOptionsErrorCode INCLUDED_FILE_PARSE_ERROR =
3941
AnalysisOptionsErrorCode(
4042
'INCLUDED_FILE_PARSE_ERROR',
@@ -44,7 +46,7 @@ class AnalysisOptionsErrorCode extends DiagnosticCode {
4446
/// An error code indicating that there is a syntactic error in the file.
4547
///
4648
/// Parameters:
47-
/// 0: the error message from the parse error
49+
/// Object p0: the error message from the parse error
4850
static const AnalysisOptionsErrorCode PARSE_ERROR = AnalysisOptionsErrorCode(
4951
'PARSE_ERROR',
5052
"{0}",
@@ -75,7 +77,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
7577
/// An error code indicating that the given option is deprecated.
7678
///
7779
/// Parameters:
78-
/// 0: the option name
80+
/// Object p0: the option name
7981
static const AnalysisOptionsWarningCode ANALYSIS_OPTION_DEPRECATED =
8082
AnalysisOptionsWarningCode(
8183
'ANALYSIS_OPTION_DEPRECATED',
@@ -85,8 +87,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
8587
/// An error code indicating that the given option is deprecated.
8688
///
8789
/// Parameters:
88-
/// 0: the option name
89-
/// 1: the replacement option name
90+
/// Object p0: the option name
91+
/// Object p1: the replacement option name
9092
static const AnalysisOptionsWarningCode
9193
ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT = AnalysisOptionsWarningCode(
9294
'ANALYSIS_OPTION_DEPRECATED',
@@ -98,7 +100,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
98100
/// A hint code indicating reference to a deprecated lint.
99101
///
100102
/// Parameters:
101-
/// 0: the rule name
103+
/// String p0: the rule name
102104
static const AnalysisOptionsWarningCode DEPRECATED_LINT =
103105
AnalysisOptionsWarningCode(
104106
'DEPRECATED_LINT',
@@ -109,8 +111,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
109111
/// A hint code indicating reference to a deprecated lint.
110112
///
111113
/// Parameters:
112-
/// 0: the deprecated lint name
113-
/// 1: the replacing rule name
114+
/// String p0: the deprecated lint name
115+
/// String p1: the replacing rule name
114116
static const AnalysisOptionsWarningCode DEPRECATED_LINT_WITH_REPLACEMENT =
115117
AnalysisOptionsWarningCode(
116118
'DEPRECATED_LINT_WITH_REPLACEMENT',
@@ -121,7 +123,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
121123
/// Duplicate rules.
122124
///
123125
/// Parameters:
124-
/// 0: the rule name
126+
/// String p0: the rule name
125127
static const AnalysisOptionsWarningCode
126128
DUPLICATE_RULE = AnalysisOptionsWarningCode(
127129
'DUPLICATE_RULE',
@@ -132,10 +134,12 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
132134
/// An error code indicating a specified include file has a warning.
133135
///
134136
/// Parameters:
135-
/// 0: the path of the file containing the warnings
136-
/// 1: the starting offset of the text in the file that contains the warning
137-
/// 2: the ending offset of the text in the file that contains the warning
138-
/// 3: the warning message
137+
/// Object p0: the path of the file containing the warnings
138+
/// Object p1: the starting offset of the text in the file that contains the
139+
/// warning
140+
/// Object p2: the ending offset of the text in the file that contains the
141+
/// warning
142+
/// Object p3: the warning message
139143
static const AnalysisOptionsWarningCode INCLUDED_FILE_WARNING =
140144
AnalysisOptionsWarningCode(
141145
'INCLUDED_FILE_WARNING',
@@ -145,9 +149,9 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
145149
/// An error code indicating a specified include file could not be found.
146150
///
147151
/// Parameters:
148-
/// 0: the URI of the file to be included
149-
/// 1: the path of the file containing the include directive
150-
/// 2: the path of the context being analyzed
152+
/// Object p0: the URI of the file to be included
153+
/// Object p1: the path of the file containing the include directive
154+
/// Object p2: the path of the context being analyzed
151155
static const AnalysisOptionsWarningCode INCLUDE_FILE_NOT_FOUND =
152156
AnalysisOptionsWarningCode(
153157
'INCLUDE_FILE_NOT_FOUND',
@@ -157,8 +161,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
157161
/// An error code indicating an incompatible rule.
158162
///
159163
/// Parameters:
160-
/// 0: the rule name
161-
/// 1: the incompatible rule
164+
/// String p0: the rule name
165+
/// String p1: the incompatible rule
162166
static const AnalysisOptionsWarningCode INCOMPATIBLE_LINT =
163167
AnalysisOptionsWarningCode(
164168
'INCOMPATIBLE_LINT',
@@ -170,8 +174,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
170174
/// value for an option and a detail message is provided.
171175
///
172176
/// Parameters:
173-
/// 0: the option name
174-
/// 1: the detail message
177+
/// String p0: the option name
178+
/// String p1: the detail message
175179
static const AnalysisOptionsWarningCode INVALID_OPTION =
176180
AnalysisOptionsWarningCode(
177181
'INVALID_OPTION',
@@ -181,7 +185,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
181185
/// An error code indicating an invalid format for an options file section.
182186
///
183187
/// Parameters:
184-
/// 0: the section name
188+
/// String p0: the section name
185189
static const AnalysisOptionsWarningCode INVALID_SECTION_FORMAT =
186190
AnalysisOptionsWarningCode(
187191
'INVALID_SECTION_FORMAT',
@@ -191,7 +195,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
191195
/// An error code indicating multiple plugins have been specified as enabled.
192196
///
193197
/// Parameters:
194-
/// 0: the name of the first plugin
198+
/// String p0: the name of the first plugin
195199
static const AnalysisOptionsWarningCode MULTIPLE_PLUGINS =
196200
AnalysisOptionsWarningCode(
197201
'MULTIPLE_PLUGINS',
@@ -202,8 +206,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
202206
/// An error code indicating a specified include file includes itself recursively.
203207
///
204208
/// Parameters:
205-
/// 0: the URI of the file to be included
206-
/// 1: the path of the file containing the include directive
209+
/// Object p0: the URI of the file to be included
210+
/// Object p1: the path of the file containing the include directive
207211
static const AnalysisOptionsWarningCode RECURSIVE_INCLUDE_FILE =
208212
AnalysisOptionsWarningCode(
209213
'RECURSIVE_INCLUDE_FILE',
@@ -215,8 +219,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
215219
/// An error code indicating a removed lint rule.
216220
///
217221
/// Parameters:
218-
/// 0: the rule name
219-
/// 1: the SDK version in which the lint was removed
222+
/// String p0: the rule name
223+
/// String p1: the SDK version in which the lint was removed
220224
static const AnalysisOptionsWarningCode REMOVED_LINT =
221225
AnalysisOptionsWarningCode(
222226
'REMOVED_LINT',
@@ -227,9 +231,9 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
227231
/// An error code indicating a removed lint rule.
228232
///
229233
/// Parameters:
230-
/// 0: the rule name
231-
/// 1: the SDK version in which the lint was removed
232-
/// 2: the name of a replacing lint
234+
/// String p0: the rule name
235+
/// String p1: the SDK version in which the lint was removed
236+
/// String p2: the name of a replacing lint
233237
static const AnalysisOptionsWarningCode REPLACED_LINT =
234238
AnalysisOptionsWarningCode(
235239
'REPLACED_LINT',
@@ -240,7 +244,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
240244
/// An error code indicating an undefined lint rule.
241245
///
242246
/// Parameters:
243-
/// 0: the rule name
247+
/// String p0: the rule name
244248
static const AnalysisOptionsWarningCode UNDEFINED_LINT =
245249
AnalysisOptionsWarningCode(
246250
'UNDEFINED_LINT',
@@ -252,7 +256,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
252256
/// specify an error filter.
253257
///
254258
/// Parameters:
255-
/// 0: the unrecognized error code
259+
/// String p0: the unrecognized error code
256260
static const AnalysisOptionsWarningCode UNRECOGNIZED_ERROR_CODE =
257261
AnalysisOptionsWarningCode(
258262
'UNRECOGNIZED_ERROR_CODE',
@@ -263,8 +267,8 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
263267
/// unsupported option and legal options are provided.
264268
///
265269
/// Parameters:
266-
/// 0: the plugin name
267-
/// 1: the unsupported option key
270+
/// String p0: the plugin name
271+
/// String p1: the unsupported option key
268272
static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITHOUT_VALUES =
269273
AnalysisOptionsWarningCode(
270274
'UNSUPPORTED_OPTION_WITHOUT_VALUES',
@@ -275,9 +279,9 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
275279
/// unsupported option where there is just one legal value.
276280
///
277281
/// Parameters:
278-
/// 0: the section name
279-
/// 1: the unsupported option key
280-
/// 2: the legal value
282+
/// String p0: the section name
283+
/// String p1: the unsupported option key
284+
/// String p2: the legal value
281285
static const AnalysisOptionsWarningCode
282286
UNSUPPORTED_OPTION_WITH_LEGAL_VALUE = AnalysisOptionsWarningCode(
283287
'UNSUPPORTED_OPTION_WITH_LEGAL_VALUE',
@@ -289,9 +293,9 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
289293
/// unsupported option and legal options are provided.
290294
///
291295
/// Parameters:
292-
/// 0: the section name
293-
/// 1: the unsupported option key
294-
/// 2: legal values
296+
/// String p0: the section name
297+
/// String p1: the unsupported option key
298+
/// String p2: legal values
295299
static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES =
296300
AnalysisOptionsWarningCode(
297301
'UNSUPPORTED_OPTION_WITH_LEGAL_VALUES',
@@ -303,9 +307,9 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
303307
/// unsupported value.
304308
///
305309
/// Parameters:
306-
/// 0: the option name
307-
/// 1: the unsupported value
308-
/// 2: legal values
310+
/// String p0: the option name
311+
/// int p1: the unsupported value
312+
/// String p2: legal values
309313
static const AnalysisOptionsWarningCode UNSUPPORTED_VALUE =
310314
AnalysisOptionsWarningCode(
311315
'UNSUPPORTED_VALUE',

0 commit comments

Comments
 (0)