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/search/search_engine.dart'; | 8 import 'package:analysis_server/src/services/search/search_engine.dart'; |
9 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 9 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const FixKind( | 99 const FixKind( |
100 'REMOVE_PARENTHESIS_IN_GETTER_INVOCATION', | 100 'REMOVE_PARENTHESIS_IN_GETTER_INVOCATION', |
101 50, | 101 50, |
102 "Remove parentheses in getter invocation"); | 102 "Remove parentheses in getter invocation"); |
103 static const REMOVE_UNNECASSARY_CAST = | 103 static const REMOVE_UNNECASSARY_CAST = |
104 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); | 104 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); |
105 static const REMOVE_UNUSED_IMPORT = | 105 static const REMOVE_UNUSED_IMPORT = |
106 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); | 106 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); |
107 static const REPLACE_BOOLEAN_WITH_BOOL = | 107 static const REPLACE_BOOLEAN_WITH_BOOL = |
108 const FixKind('REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bo
ol'"); | 108 const FixKind('REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bo
ol'"); |
| 109 static const REPLACE_IMPORT_URI = |
| 110 const FixKind('REPLACE_IMPORT_URI', 50, "Replace with '{0}'"); |
109 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); | 111 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); |
110 static const USE_EFFECTIVE_INTEGER_DIVISION = | 112 static const USE_EFFECTIVE_INTEGER_DIVISION = |
111 const FixKind( | 113 const FixKind( |
112 'USE_EFFECTIVE_INTEGER_DIVISION', | 114 'USE_EFFECTIVE_INTEGER_DIVISION', |
113 50, | 115 50, |
114 "Use effective integer division ~/"); | 116 "Use effective integer division ~/"); |
115 static const USE_EQ_EQ_NULL = | 117 static const USE_EQ_EQ_NULL = |
116 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); | 118 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); |
117 static const USE_NOT_EQ_NULL = | 119 static const USE_NOT_EQ_NULL = |
118 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); | 120 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); |
119 | 121 |
120 final name; | 122 final name; |
121 final int relevance; | 123 final int relevance; |
122 final String message; | 124 final String message; |
123 | 125 |
124 const FixKind(this.name, this.relevance, this.message); | 126 const FixKind(this.name, this.relevance, this.message); |
125 | 127 |
126 @override | 128 @override |
127 String toString() => name; | 129 String toString() => name; |
128 } | 130 } |
OLD | NEW |