| 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 services.correction.fix; | 5 library services.correction.fix; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart' show SourceChange; | 7 import 'package:analysis_server/src/protocol.dart' show SourceChange; |
| 8 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 8 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static const MAKE_CLASS_ABSTRACT = | 92 static const MAKE_CLASS_ABSTRACT = |
| 93 const FixKind('MAKE_CLASS_ABSTRACT', 50, "Make class '{0}' abstract"); | 93 const FixKind('MAKE_CLASS_ABSTRACT', 50, "Make class '{0}' abstract"); |
| 94 static const REMOVE_PARAMETERS_IN_GETTER_DECLARATION = const FixKind( | 94 static const REMOVE_PARAMETERS_IN_GETTER_DECLARATION = const FixKind( |
| 95 'REMOVE_PARAMETERS_IN_GETTER_DECLARATION', 50, | 95 'REMOVE_PARAMETERS_IN_GETTER_DECLARATION', 50, |
| 96 "Remove parameters in getter declaration"); | 96 "Remove parameters in getter declaration"); |
| 97 static const REMOVE_PARENTHESIS_IN_GETTER_INVOCATION = const FixKind( | 97 static const REMOVE_PARENTHESIS_IN_GETTER_INVOCATION = const FixKind( |
| 98 'REMOVE_PARENTHESIS_IN_GETTER_INVOCATION', 50, | 98 'REMOVE_PARENTHESIS_IN_GETTER_INVOCATION', 50, |
| 99 "Remove parentheses in getter invocation"); | 99 "Remove parentheses in getter invocation"); |
| 100 static const REMOVE_UNNECASSARY_CAST = | 100 static const REMOVE_UNNECASSARY_CAST = |
| 101 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); | 101 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); |
| 102 static const REMOVE_UNUSED_CATCH_CLAUSE = const FixKind( |
| 103 'REMOVE_UNUSED_CATCH', 50, "Remove unused 'catch' clause"); |
| 104 static const REMOVE_UNUSED_CATCH_STACK = const FixKind( |
| 105 'REMOVE_UNUSED_CATCH_STACK', 50, "Remove unused stack trace variable"); |
| 102 static const REMOVE_UNUSED_IMPORT = | 106 static const REMOVE_UNUSED_IMPORT = |
| 103 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); | 107 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); |
| 104 static const REPLACE_BOOLEAN_WITH_BOOL = const FixKind( | 108 static const REPLACE_BOOLEAN_WITH_BOOL = const FixKind( |
| 105 'REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bool'"); | 109 'REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bool'"); |
| 106 static const REPLACE_IMPORT_URI = | 110 static const REPLACE_IMPORT_URI = |
| 107 const FixKind('REPLACE_IMPORT_URI', 50, "Replace with '{0}'"); | 111 const FixKind('REPLACE_IMPORT_URI', 50, "Replace with '{0}'"); |
| 108 static const REPLACE_VAR_WITH_DYNAMIC = const FixKind( | 112 static const REPLACE_VAR_WITH_DYNAMIC = const FixKind( |
| 109 'REPLACE_VAR_WITH_DYNAMIC', 50, "Replace 'var' with 'dynamic'"); | 113 'REPLACE_VAR_WITH_DYNAMIC', 50, "Replace 'var' with 'dynamic'"); |
| 110 static const REPLACE_RETURN_TYPE_FUTURE = const FixKind( | 114 static const REPLACE_RETURN_TYPE_FUTURE = const FixKind( |
| 111 'REPLACE_RETURN_TYPE_FUTURE', 50, | 115 'REPLACE_RETURN_TYPE_FUTURE', 50, |
| 112 "Return 'Future' from 'async' function"); | 116 "Return 'Future' from 'async' function"); |
| 113 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); | 117 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); |
| 114 static const USE_EFFECTIVE_INTEGER_DIVISION = const FixKind( | 118 static const USE_EFFECTIVE_INTEGER_DIVISION = const FixKind( |
| 115 'USE_EFFECTIVE_INTEGER_DIVISION', 50, | 119 'USE_EFFECTIVE_INTEGER_DIVISION', 50, |
| 116 "Use effective integer division ~/"); | 120 "Use effective integer division ~/"); |
| 117 static const USE_EQ_EQ_NULL = | 121 static const USE_EQ_EQ_NULL = |
| 118 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); | 122 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); |
| 119 static const USE_NOT_EQ_NULL = | 123 static const USE_NOT_EQ_NULL = |
| 120 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); | 124 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); |
| 121 | 125 |
| 122 final name; | 126 final name; |
| 123 final int relevance; | 127 final int relevance; |
| 124 final String message; | 128 final String message; |
| 125 | 129 |
| 126 const FixKind(this.name, this.relevance, this.message); | 130 const FixKind(this.name, this.relevance, this.message); |
| 127 | 131 |
| 128 @override | 132 @override |
| 129 String toString() => name; | 133 String toString() => name; |
| 130 } | 134 } |
| OLD | NEW |