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.generated.error; | 5 library analyzer.src.generated.error; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; | 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
11 import 'package:analyzer/dart/element/element.dart'; | 11 import 'package:analyzer/dart/element/element.dart'; |
12 import 'package:analyzer/dart/element/type.dart'; | 12 import 'package:analyzer/dart/element/type.dart'; |
13 import 'package:analyzer/source/error_processor.dart'; | 13 import 'package:analyzer/source/error_processor.dart'; |
14 import 'package:analyzer/src/dart/element/type.dart'; | 14 import 'package:analyzer/src/dart/element/type.dart'; |
15 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 15 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
16 import 'package:analyzer/src/generated/engine.dart'; | |
17 import 'package:analyzer/src/generated/generated/shared_messages.dart' | 16 import 'package:analyzer/src/generated/generated/shared_messages.dart' |
18 as shared_messages; | 17 as shared_messages; |
19 import 'package:analyzer/src/generated/java_core.dart'; | 18 import 'package:analyzer/src/generated/java_core.dart'; |
20 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 19 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
21 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
22 import 'package:analyzer/src/task/model.dart'; | 21 import 'package:analyzer/src/task/model.dart'; |
23 import 'package:analyzer/task/model.dart'; | 22 import 'package:analyzer/task/model.dart'; |
24 import 'package:source_span/source_span.dart'; | 23 import 'package:source_span/source_span.dart'; |
25 | 24 |
26 /** | 25 /** |
(...skipping 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 * Generate a hint for a constructor, function or method invocation where a | 3578 * Generate a hint for a constructor, function or method invocation where a |
3580 * required parameter is missing. | 3579 * required parameter is missing. |
3581 * | 3580 * |
3582 * Parameters: | 3581 * Parameters: |
3583 * 0: the name of the parameter | 3582 * 0: the name of the parameter |
3584 * 1: an optional reason | 3583 * 1: an optional reason |
3585 */ | 3584 */ |
3586 static const HintCode MISSING_REQUIRED_PARAM = const HintCode( | 3585 static const HintCode MISSING_REQUIRED_PARAM = const HintCode( |
3587 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}"); | 3586 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}"); |
3588 | 3587 |
3589 /** | 3588 /** |
3590 * Generate a hint for an element that is annotated with `@JS(...)` whose | 3589 * Generate a hint for an element that is annotated with `@JS(...)` whose |
3591 * library declaration is not similarly annotated. | 3590 * library declaration is not similarly annotated. |
3592 */ | 3591 */ |
3593 static const HintCode MISSING_JS_LIB_ANNOTATION = const HintCode( | 3592 static const HintCode MISSING_JS_LIB_ANNOTATION = const HintCode( |
3594 'MISSING_JS_LIB_ANNOTATION', | 3593 'MISSING_JS_LIB_ANNOTATION', |
3595 "The @JS() annotation can only be used if it is also declared on the libra
ry directive."); | 3594 "The @JS() annotation can only be used if it is also declared on the libra
ry directive."); |
3596 | 3595 |
3597 /** | 3596 /** |
3598 * Generate a hint for methods or functions that have a return type, but do | 3597 * Generate a hint for methods or functions that have a return type, but do |
3599 * not have a non-void return statement on all branches. At the end of methods | 3598 * not have a non-void return statement on all branches. At the end of methods |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3784 /** | 3783 /** |
3785 * Unused local variables are local variables which are never read. | 3784 * Unused local variables are local variables which are never read. |
3786 */ | 3785 */ |
3787 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode( | 3786 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode( |
3788 'UNUSED_LOCAL_VARIABLE', | 3787 'UNUSED_LOCAL_VARIABLE', |
3789 "The value of the local variable '{0}' is not used"); | 3788 "The value of the local variable '{0}' is not used"); |
3790 | 3789 |
3791 /** | 3790 /** |
3792 * Unused shown names are names shown on imports which are never used. | 3791 * Unused shown names are names shown on imports which are never used. |
3793 */ | 3792 */ |
3794 static const HintCode UNUSED_SHOWN_NAME = | 3793 static const HintCode UNUSED_SHOWN_NAME = const HintCode( |
3795 const HintCode('UNUSED_SHOWN_NAME', "The name {0} is shown, but not used."
); | 3794 'UNUSED_SHOWN_NAME', "The name {0} is shown, but not used."); |
3796 | 3795 |
3797 /** | 3796 /** |
3798 * Hint for cases where the source expects a method or function to return a | 3797 * Hint for cases where the source expects a method or function to return a |
3799 * non-void result, but the method or function signature returns void. | 3798 * non-void result, but the method or function signature returns void. |
3800 * | 3799 * |
3801 * Parameters: | 3800 * Parameters: |
3802 * 0: the name of the method or function that returns void | 3801 * 0: the name of the method or function that returns void |
3803 */ | 3802 */ |
3804 static const HintCode USE_OF_VOID_RESULT = const HintCode( | 3803 static const HintCode USE_OF_VOID_RESULT = const HintCode( |
3805 'USE_OF_VOID_RESULT', | 3804 'USE_OF_VOID_RESULT', |
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5784 * Initialize a newly created error code to have the given [name]. | 5783 * Initialize a newly created error code to have the given [name]. |
5785 */ | 5784 */ |
5786 const TodoCode(String name) : super(name, "{0}"); | 5785 const TodoCode(String name) : super(name, "{0}"); |
5787 | 5786 |
5788 @override | 5787 @override |
5789 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5788 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
5790 | 5789 |
5791 @override | 5790 @override |
5792 ErrorType get type => ErrorType.TODO; | 5791 ErrorType get type => ErrorType.TODO; |
5793 } | 5792 } |
OLD | NEW |