| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 static const REMOVE_UNNECASSARY_CAST = | 95 static const REMOVE_UNNECASSARY_CAST = |
| 96 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); | 96 const FixKind('REMOVE_UNNECASSARY_CAST', 50, "Remove unnecessary cast"); |
| 97 static const REMOVE_UNUSED_IMPORT = | 97 static const REMOVE_UNUSED_IMPORT = |
| 98 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); | 98 const FixKind('REMOVE_UNUSED_IMPORT', 50, "Remove unused import"); |
| 99 static const REPLACE_BOOLEAN_WITH_BOOL = const FixKind( | 99 static const REPLACE_BOOLEAN_WITH_BOOL = const FixKind( |
| 100 'REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bool'"); | 100 'REPLACE_BOOLEAN_WITH_BOOL', 50, "Replace 'boolean' with 'bool'"); |
| 101 static const REPLACE_IMPORT_URI = | 101 static const REPLACE_IMPORT_URI = |
| 102 const FixKind('REPLACE_IMPORT_URI', 50, "Replace with '{0}'"); | 102 const FixKind('REPLACE_IMPORT_URI', 50, "Replace with '{0}'"); |
| 103 static const REPLACE_VAR_WITH_DYNAMIC = const FixKind( | 103 static const REPLACE_VAR_WITH_DYNAMIC = const FixKind( |
| 104 'REPLACE_VAR_WITH_DYNAMIC', 50, "Replace 'var' with 'dynamic'"); | 104 'REPLACE_VAR_WITH_DYNAMIC', 50, "Replace 'var' with 'dynamic'"); |
| 105 static const REPLACE_RETURN_TYPE_FUTURE = const FixKind( |
| 106 'REPLACE_RETURN_TYPE_FUTURE', 50, |
| 107 "Return 'Future' from 'async' function"); |
| 105 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); | 108 static const USE_CONST = const FixKind('USE_CONST', 50, "Change to constant"); |
| 106 static const USE_EFFECTIVE_INTEGER_DIVISION = const FixKind( | 109 static const USE_EFFECTIVE_INTEGER_DIVISION = const FixKind( |
| 107 'USE_EFFECTIVE_INTEGER_DIVISION', 50, | 110 'USE_EFFECTIVE_INTEGER_DIVISION', 50, |
| 108 "Use effective integer division ~/"); | 111 "Use effective integer division ~/"); |
| 109 static const USE_EQ_EQ_NULL = | 112 static const USE_EQ_EQ_NULL = |
| 110 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); | 113 const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'"); |
| 111 static const USE_NOT_EQ_NULL = | 114 static const USE_NOT_EQ_NULL = |
| 112 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); | 115 const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'"); |
| 113 | 116 |
| 114 final name; | 117 final name; |
| 115 final int relevance; | 118 final int relevance; |
| 116 final String message; | 119 final String message; |
| 117 | 120 |
| 118 const FixKind(this.name, this.relevance, this.message); | 121 const FixKind(this.name, this.relevance, this.message); |
| 119 | 122 |
| 120 @override | 123 @override |
| 121 String toString() => name; | 124 String toString() => name; |
| 122 } | 125 } |
| OLD | NEW |