| 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.src.refactoring.extract_method; | 5 library services.src.refactoring.extract_method; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol_server.dart' hide Element; | 9 import 'package:analysis_server/src/protocol_server.dart' hide Element; |
| 10 import 'package:analysis_server/src/services/correction/name_suggestion.dart'; | 10 import 'package:analysis_server/src/services/correction/name_suggestion.dart'; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // name | 162 // name |
| 163 sb.write(parameter.name); | 163 sb.write(parameter.name); |
| 164 } | 164 } |
| 165 sb.write(')'); | 165 sb.write(')'); |
| 166 } | 166 } |
| 167 // done | 167 // done |
| 168 return sb.toString(); | 168 return sb.toString(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 @override | 171 @override |
| 172 Future<RefactoringStatus> checkFinalConditions() { | 172 Future<RefactoringStatus> checkFinalConditions() async { |
| 173 RefactoringStatus result = new RefactoringStatus(); | 173 RefactoringStatus result = new RefactoringStatus(); |
| 174 result.addStatus(validateMethodName(name)); | 174 result.addStatus(validateMethodName(name)); |
| 175 result.addStatus(_checkParameterNames()); | 175 result.addStatus(_checkParameterNames()); |
| 176 return _checkPossibleConflicts().then((status) { | 176 RefactoringStatus status = await _checkPossibleConflicts(); |
| 177 result.addStatus(status); | 177 result.addStatus(status); |
| 178 return result; | 178 return result; |
| 179 }); | |
| 180 } | 179 } |
| 181 | 180 |
| 182 | 181 |
| 183 @override | 182 @override |
| 184 Future<RefactoringStatus> checkInitialConditions() { | 183 Future<RefactoringStatus> checkInitialConditions() { |
| 185 RefactoringStatus result = new RefactoringStatus(); | 184 RefactoringStatus result = new RefactoringStatus(); |
| 186 // selection | 185 // selection |
| 187 result.addStatus(_checkSelection()); | 186 result.addStatus(_checkSelection()); |
| 188 if (result.hasFatalError) { | 187 if (result.hasFatalError) { |
| 189 return new Future.value(result); | 188 return new Future.value(result); |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 return false; | 1181 return false; |
| 1183 } | 1182 } |
| 1184 for (int i = 0; i < parameterTypes.length; i++) { | 1183 for (int i = 0; i < parameterTypes.length; i++) { |
| 1185 if (other.parameterTypes[i] != parameterTypes[i]) { | 1184 if (other.parameterTypes[i] != parameterTypes[i]) { |
| 1186 return false; | 1185 return false; |
| 1187 } | 1186 } |
| 1188 } | 1187 } |
| 1189 return true; | 1188 return true; |
| 1190 } | 1189 } |
| 1191 } | 1190 } |
| OLD | NEW |