Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 1418533004: Unsupported analysis option validation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 'ast.dart' show AstNode; 9 import 'ast.dart' show AstNode;
10 import 'element.dart'; 10 import 'element.dart';
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 /** 287 /**
288 * Set the value of the given [property] to the given [value]. Using a value 288 * Set the value of the given [property] to the given [value]. Using a value
289 * of `null` will effectively remove the property from this error. 289 * of `null` will effectively remove the property from this error.
290 */ 290 */
291 void setProperty(ErrorProperty property, Object value) { 291 void setProperty(ErrorProperty property, Object value) {
292 _propertyMap[property] = value; 292 _propertyMap[property] = value;
293 } 293 }
294 } 294 }
295 295
296 /** 296 /**
297 * The error codes used for errors in analysis options files. The convention for 297 * The error codes used for errors in analysis options files.
298 * this class is for the name of the error code to indicate the problem that
299 * caused the error to be generated and for the error message to explain what is
300 * wrong and, when appropriate, how the problem can be corrected.
301 */ 298 */
302 class AnalysisOptionsErrorCode extends ErrorCode { 299 class AnalysisOptionsErrorCode extends ErrorCode {
303 /** 300 /**
304 * An error code indicating that there is a syntactic error in the file. 301 * An error code indicating that there is a syntactic error in the file.
305 * 302 *
306 * Parameters: 303 * Parameters:
307 * 0: the error message from the parse error 304 * 0: the error message from the parse error
308 */ 305 */
309 static const AnalysisOptionsErrorCode PARSE_ERROR = 306 static const AnalysisOptionsErrorCode PARSE_ERROR =
310 const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}'); 307 const AnalysisOptionsErrorCode('PARSE_ERROR', '{0}');
311 308
312 /** 309 /**
313 * Initialize a newly created error code to have the given [name]. The message 310 * Initialize a newly created error code to have the given [name].
Brian Wilkerson 2015/10/21 21:13:58 Not sure why you'd want to drop the documentation.
314 * associated with the error will be created from the given [message]
315 * template. The correction associated with the error will be created from the
316 * given [correction] template.
317 */ 311 */
318 const AnalysisOptionsErrorCode(String name, String message, 312 const AnalysisOptionsErrorCode(String name, String message,
319 [String correction]) 313 [String correction])
320 : super(name, message, correction); 314 : super(name, message, correction);
321 315
322 @override 316 @override
323 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 317 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
324 318
325 @override 319 @override
326 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; 320 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
327 } 321 }
328 322
329 /** 323 /**
324 * The error codes used for warnings in analysis options files.
325 */
326 class AnalysisOptionsWarningCode extends ErrorCode {
327 /**
328 * An error code indicating that a plugin is being configured with an
329 * unsupported option.
330 *
331 * Parameters:
332 * 0: the plugin name
333 * 1: the unsupported option key
334 */
335 static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION =
336 const AnalysisOptionsWarningCode('UNSUPPORTED_OPTION_ERROR',
337 "The option '{1}' is not supported by {0}");
338
339 /**
340 * Initialize a newly created warning code to have the given [name].
341 */
342 const AnalysisOptionsWarningCode(String name, String message,
343 [String correction])
344 : super(name, message, correction);
345
346 @override
347 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
348
349 @override
350 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
scheglov 2015/10/21 21:01:24 STATIC_WARNING?
pquitslund 2015/10/21 21:04:51 Done.
351 }
352
353 /**
330 * An [AnalysisErrorListener] that keeps track of whether any error has been 354 * An [AnalysisErrorListener] that keeps track of whether any error has been
331 * reported to it. 355 * reported to it.
332 */ 356 */
333 class BooleanErrorListener implements AnalysisErrorListener { 357 class BooleanErrorListener implements AnalysisErrorListener {
334 /** 358 /**
335 * A flag indicating whether an error has been reported to this listener. 359 * A flag indicating whether an error has been reported to this listener.
336 */ 360 */
337 bool _errorReported = false; 361 bool _errorReported = false;
338 362
339 /** 363 /**
(...skipping 4691 matching lines...) Expand 10 before | Expand all | Expand 10 after
5031 * Initialize a newly created error code to have the given [name]. 5055 * Initialize a newly created error code to have the given [name].
5032 */ 5056 */
5033 const TodoCode(String name) : super(name, "{0}"); 5057 const TodoCode(String name) : super(name, "{0}");
5034 5058
5035 @override 5059 @override
5036 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5060 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5037 5061
5038 @override 5062 @override
5039 ErrorType get type => ErrorType.TODO; 5063 ErrorType get type => ErrorType.TODO;
5040 } 5064 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/options.dart » ('j') | pkg/analyzer/lib/src/task/options.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698