| 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 26 matching lines...) Expand all Loading... |
| 37 return '[kind=$kind, change=$change]'; | 37 return '[kind=$kind, change=$change]'; |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * An enumeration of possible quick fix kinds. | 42 * An enumeration of possible quick fix kinds. |
| 43 */ | 43 */ |
| 44 class FixKind { | 44 class FixKind { |
| 45 static const ADD_ASYNC = | 45 static const ADD_ASYNC = |
| 46 const FixKind('ADD_ASYNC', 50, "Add 'async' modifier"); | 46 const FixKind('ADD_ASYNC', 50, "Add 'async' modifier"); |
| 47 static const ADD_FIELD_FORMAL_PARAMETERS = const FixKind( |
| 48 'ADD_FIELD_FORMAL_PARAMETERS', 30, "Add final field formal parameters"); |
| 47 static const ADD_PACKAGE_DEPENDENCY = const FixKind( | 49 static const ADD_PACKAGE_DEPENDENCY = const FixKind( |
| 48 'ADD_PACKAGE_DEPENDENCY', 50, "Add dependency on package '{0}'"); | 50 'ADD_PACKAGE_DEPENDENCY', 50, "Add dependency on package '{0}'"); |
| 49 static const ADD_SUPER_CONSTRUCTOR_INVOCATION = const FixKind( | 51 static const ADD_SUPER_CONSTRUCTOR_INVOCATION = const FixKind( |
| 50 'ADD_SUPER_CONSTRUCTOR_INVOCATION', 50, | 52 'ADD_SUPER_CONSTRUCTOR_INVOCATION', 50, |
| 51 "Add super constructor {0} invocation"); | 53 "Add super constructor {0} invocation"); |
| 52 static const CHANGE_TO = const FixKind('CHANGE_TO', 49, "Change to '{0}'"); | 54 static const CHANGE_TO = const FixKind('CHANGE_TO', 49, "Change to '{0}'"); |
| 53 static const CHANGE_TO_STATIC_ACCESS = const FixKind( | 55 static const CHANGE_TO_STATIC_ACCESS = const FixKind( |
| 54 'CHANGE_TO_STATIC_ACCESS', 50, "Change access to static using '{0}'"); | 56 'CHANGE_TO_STATIC_ACCESS', 50, "Change access to static using '{0}'"); |
| 55 static const CREATE_CLASS = | 57 static const CREATE_CLASS = |
| 56 const FixKind('CREATE_CLASS', 50, "Create class '{0}'"); | 58 const FixKind('CREATE_CLASS', 50, "Create class '{0}'"); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |