| 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.rename_class_member; | 5 library services.src.refactoring.rename_class_member; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol_server.dart' | 9 import 'package:analysis_server/src/protocol_server.dart' |
| 10 hide Element, ElementKind; | 10 hide Element, ElementKind; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 new _ClassMemberValidator.forRename(searchEngine, element, newName); | 56 new _ClassMemberValidator.forRename(searchEngine, element, newName); |
| 57 return _validator.validate(); | 57 return _validator.validate(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 @override | 60 @override |
| 61 Future<RefactoringStatus> checkInitialConditions() async { | 61 Future<RefactoringStatus> checkInitialConditions() async { |
| 62 RefactoringStatus result = await super.checkInitialConditions(); | 62 RefactoringStatus result = await super.checkInitialConditions(); |
| 63 if (element is MethodElement && (element as MethodElement).isOperator) { | 63 if (element is MethodElement && (element as MethodElement).isOperator) { |
| 64 result.addFatalError('Cannot rename operator.'); | 64 result.addFatalError('Cannot rename operator.'); |
| 65 } | 65 } |
| 66 return new Future.value(result); | 66 return new Future<RefactoringStatus>.value(result); |
| 67 } | 67 } |
| 68 | 68 |
| 69 @override | 69 @override |
| 70 RefactoringStatus checkNewName() { | 70 RefactoringStatus checkNewName() { |
| 71 RefactoringStatus result = super.checkNewName(); | 71 RefactoringStatus result = super.checkNewName(); |
| 72 if (element is FieldElement) { | 72 if (element is FieldElement) { |
| 73 result.addStatus(validateFieldName(newName)); | 73 result.addStatus(validateFieldName(newName)); |
| 74 } | 74 } |
| 75 if (element is MethodElement) { | 75 if (element is MethodElement) { |
| 76 result.addStatus(validateMethodName(newName)); | 76 result.addStatus(validateMethodName(newName)); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 class _MatchShadowedByLocal { | 312 class _MatchShadowedByLocal { |
| 313 final SearchMatch match; | 313 final SearchMatch match; |
| 314 final LocalElement localElement; | 314 final LocalElement localElement; |
| 315 | 315 |
| 316 _MatchShadowedByLocal(this.match, this.localElement); | 316 _MatchShadowedByLocal(this.match, this.localElement); |
| 317 } | 317 } |
| OLD | NEW |