| 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_constructor; | 5 library services.src.refactoring.rename_constructor; |
| 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/source_range.dart'; | 10 import 'package:analysis_server/src/services/correction/source_range.dart'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 element.library.source.uri.toString(), | 105 element.library.source.uri.toString(), |
| 106 element.source.uri.toString(), | 106 element.source.uri.toString(), |
| 107 MatchKind.DECLARATION, | 107 MatchKind.DECLARATION, |
| 108 sourceRange, | 108 sourceRange, |
| 109 true, | 109 true, |
| 110 true)); | 110 true)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 Future<Null> _replaceSynthetic() async { | 113 Future<Null> _replaceSynthetic() async { |
| 114 ClassElement classElement = element.enclosingElement; | 114 ClassElement classElement = element.enclosingElement; |
| 115 ClassDeclaration classNode = | 115 AstNode name = await astProvider.getResolvedNameForElement(classElement); |
| 116 await astProvider.getResolvedNodeForElement(classElement); | 116 ClassDeclaration classNode = name.parent as ClassDeclaration; |
| 117 CorrectionUtils utils = new CorrectionUtils(classNode.parent); | 117 CorrectionUtils utils = new CorrectionUtils(classNode.parent); |
| 118 ClassMemberLocation location = | 118 ClassMemberLocation location = |
| 119 utils.prepareNewConstructorLocation(classNode); | 119 utils.prepareNewConstructorLocation(classNode); |
| 120 doSourceChange_addElementEdit( | 120 doSourceChange_addElementEdit( |
| 121 change, | 121 change, |
| 122 classElement, | 122 classElement, |
| 123 new SourceEdit( | 123 new SourceEdit( |
| 124 location.offset, | 124 location.offset, |
| 125 0, | 125 0, |
| 126 location.prefix + | 126 location.prefix + |
| 127 '${classElement.name}.$newName();' + | 127 '${classElement.name}.$newName();' + |
| 128 location.suffix)); | 128 location.suffix)); |
| 129 } | 129 } |
| 130 } | 130 } |
| OLD | NEW |