| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 "Class '{0}' already declares {1} with name '{2}'.", | 157 "Class '{0}' already declares {1} with name '{2}'.", |
| 158 elementClass.displayName, | 158 elementClass.displayName, |
| 159 getElementKindName(newNameMember), | 159 getElementKindName(newNameMember), |
| 160 name), | 160 name), |
| 161 newLocation_fromElement(newNameMember)); | 161 newLocation_fromElement(newNameMember)); |
| 162 } | 162 } |
| 163 // do chained computations | 163 // do chained computations |
| 164 Set<ClassElement> superClasses = getSuperClasses(elementClass); | 164 Set<ClassElement> superClasses = getSuperClasses(elementClass); |
| 165 await _prepareReferences(); | 165 await _prepareReferences(); |
| 166 Set<ClassElement> subClasses = | 166 Set<ClassElement> subClasses = |
| 167 await getSubClasses(searchEngine, elementClass); | 167 await searchEngine.searchAllSubtypes(elementClass); |
| 168 // check shadowing of class names | 168 // check shadowing of class names |
| 169 if (element != null) { | 169 if (element != null) { |
| 170 for (Element element in elements) { | 170 for (Element element in elements) { |
| 171 ClassElement clazz = element.enclosingElement; | 171 ClassElement clazz = element.enclosingElement; |
| 172 if (clazz.name == name) { | 172 if (clazz.name == name) { |
| 173 result.addError( | 173 result.addError( |
| 174 format( | 174 format( |
| 175 "Renamed {0} has the same name as the declaring class '{1}'.", | 175 "Renamed {0} has the same name as the declaring class '{1}'.", |
| 176 elementKind.displayName, | 176 elementKind.displayName, |
| 177 name), | 177 name), |
| (...skipping 130 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 |