| 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.refactoring; | 5 library services.refactoring; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' show | 9 import 'package:analysis_server/src/protocol.dart' show |
| 10 RefactoringMethodParameter, SourceChange; | 10 RefactoringMethodParameter, SourceChange; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 if (element is LocalElement) { | 305 if (element is LocalElement) { |
| 306 return new RenameLocalRefactoringImpl(searchEngine, element); | 306 return new RenameLocalRefactoringImpl(searchEngine, element); |
| 307 } | 307 } |
| 308 if (element.enclosingElement is ClassElement) { | 308 if (element.enclosingElement is ClassElement) { |
| 309 return new RenameClassMemberRefactoringImpl(searchEngine, element); | 309 return new RenameClassMemberRefactoringImpl(searchEngine, element); |
| 310 } | 310 } |
| 311 return null; | 311 return null; |
| 312 } | 312 } |
| 313 | 313 |
| 314 /** | 314 /** |
| 315 * Returns the human-readable description of the kind of element being renamed |
| 316 * (such as “class” or “function type alias”). |
| 317 */ |
| 318 String get elementKindName; |
| 319 |
| 320 /** |
| 315 * Sets the new name for the [Element]. | 321 * Sets the new name for the [Element]. |
| 316 */ | 322 */ |
| 317 void set newName(String newName); | 323 void set newName(String newName); |
| 318 | 324 |
| 319 /** | 325 /** |
| 320 * Returns the old name of the [Element] being renamed. | 326 * Returns the old name of the [Element] being renamed. |
| 321 */ | 327 */ |
| 322 String get oldName; | 328 String get oldName; |
| 323 | 329 |
| 324 /** | 330 /** |
| 325 * Validates that the [newName] is a valid identifier and is appropriate for | 331 * Validates that the [newName] is a valid identifier and is appropriate for |
| 326 * the type of the [Element] being renamed. | 332 * the type of the [Element] being renamed. |
| 327 * | 333 * |
| 328 * It does not perform all the checks (such as checking for conflicts with any | 334 * It does not perform all the checks (such as checking for conflicts with any |
| 329 * existing names in any of the scopes containing the current name), as many | 335 * existing names in any of the scopes containing the current name), as many |
| 330 * of these checkes require search engine. Use [checkFinalConditions] for this | 336 * of these checkes require search engine. Use [checkFinalConditions] for this |
| 331 * level of checking. | 337 * level of checking. |
| 332 */ | 338 */ |
| 333 RefactoringStatus checkNewName(); | 339 RefactoringStatus checkNewName(); |
| 334 } | 340 } |
| OLD | NEW |