| 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.dart' hide Element, ElementKind; | 9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; |
| 10 import 'package:analysis_server/src/services/correction/status.dart'; | 10 import 'package:analysis_server/src/services/correction/status.dart'; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // check the element being renamed is accessible | 113 // check the element being renamed is accessible |
| 114 { | 114 { |
| 115 LibraryElement whereLibrary = reference.element.library; | 115 LibraryElement whereLibrary = reference.element.library; |
| 116 if (!element.isAccessibleIn(whereLibrary)) { | 116 if (!element.isAccessibleIn(whereLibrary)) { |
| 117 continue; | 117 continue; |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 // add edit | 120 // add edit |
| 121 SourceEdit edit = | 121 SourceEdit edit = |
| 122 createReferenceEdit(reference, newName, id: _newPotentialId()); | 122 createReferenceEdit(reference, newName, id: _newPotentialId()); |
| 123 change.addEdit(reference.file, edit); | 123 addElementSourceChange(change, reference.element, edit); |
| 124 } | 124 } |
| 125 }).then((_) => change); | 125 }).then((_) => change); |
| 126 } | 126 } |
| 127 | 127 |
| 128 String _newPotentialId() { | 128 String _newPotentialId() { |
| 129 String id = potentialEditIds.length.toString(); | 129 String id = potentialEditIds.length.toString(); |
| 130 potentialEditIds.add(id); | 130 potentialEditIds.add(id); |
| 131 return id; | 131 return id; |
| 132 } | 132 } |
| 133 } | 133 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 256 } |
| 257 return _prepareElements().then((_) { | 257 return _prepareElements().then((_) { |
| 258 return Future.forEach(elements, (Element element) { | 258 return Future.forEach(elements, (Element element) { |
| 259 return searchEngine.searchReferences(element).then((references) { | 259 return searchEngine.searchReferences(element).then((references) { |
| 260 this.references.addAll(references); | 260 this.references.addAll(references); |
| 261 }); | 261 }); |
| 262 }); | 262 }); |
| 263 }); | 263 }); |
| 264 } | 264 } |
| 265 } | 265 } |
| OLD | NEW |