| 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' | 9 import 'package:analysis_server/src/protocol.dart' |
| 10 show RefactoringMethodParameter, SourceChange; | 10 show RefactoringMethodParameter, SourceChange; |
| 11 import 'package:analysis_server/src/services/correction/status.dart'; | 11 import 'package:analysis_server/src/services/correction/status.dart'; |
| 12 import 'package:analysis_server/src/services/refactoring/convert_getter_to_metho
d.dart'; | 12 import 'package:analysis_server/src/services/refactoring/convert_getter_to_metho
d.dart'; |
| 13 import 'package:analysis_server/src/services/refactoring/convert_method_to_gette
r.dart'; | 13 import 'package:analysis_server/src/services/refactoring/convert_method_to_gette
r.dart'; |
| 14 import 'package:analysis_server/src/services/refactoring/extract_local.dart'; | 14 import 'package:analysis_server/src/services/refactoring/extract_local.dart'; |
| 15 import 'package:analysis_server/src/services/refactoring/extract_method.dart'; | 15 import 'package:analysis_server/src/services/refactoring/extract_method.dart'; |
| 16 import 'package:analysis_server/src/services/refactoring/inline_local.dart'; | 16 import 'package:analysis_server/src/services/refactoring/inline_local.dart'; |
| 17 import 'package:analysis_server/src/services/refactoring/inline_method.dart'; | 17 import 'package:analysis_server/src/services/refactoring/inline_method.dart'; |
| 18 import 'package:analysis_server/src/services/refactoring/move_file.dart'; | 18 import 'package:analysis_server/src/services/refactoring/move_file.dart'; |
| 19 import 'package:analysis_server/src/services/refactoring/rename_class_member.dar
t'; | 19 import 'package:analysis_server/src/services/refactoring/rename_class_member.dar
t'; |
| 20 import 'package:analysis_server/src/services/refactoring/rename_constructor.dart
'; | 20 import 'package:analysis_server/src/services/refactoring/rename_constructor.dart
'; |
| 21 import 'package:analysis_server/src/services/refactoring/rename_import.dart'; | 21 import 'package:analysis_server/src/services/refactoring/rename_import.dart'; |
| 22 import 'package:analysis_server/src/services/refactoring/rename_label.dart'; | 22 import 'package:analysis_server/src/services/refactoring/rename_label.dart'; |
| 23 import 'package:analysis_server/src/services/refactoring/rename_library.dart'; | 23 import 'package:analysis_server/src/services/refactoring/rename_library.dart'; |
| 24 import 'package:analysis_server/src/services/refactoring/rename_local.dart'; | 24 import 'package:analysis_server/src/services/refactoring/rename_local.dart'; |
| 25 import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart
'; | 25 import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart
'; |
| 26 import 'package:analysis_server/src/services/search/search_engine.dart'; | 26 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 27 import 'package:analyzer/file_system/file_system.dart'; |
| 27 import 'package:analyzer/src/generated/ast.dart'; | 28 import 'package:analyzer/src/generated/ast.dart'; |
| 28 import 'package:analyzer/src/generated/element.dart'; | 29 import 'package:analyzer/src/generated/element.dart'; |
| 29 import 'package:analyzer/src/generated/engine.dart'; | 30 import 'package:analyzer/src/generated/engine.dart'; |
| 30 import 'package:analyzer/src/generated/source.dart'; | 31 import 'package:analyzer/src/generated/source.dart'; |
| 31 import 'package:path/path.dart' as pathos; | |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * [Refactoring] to convert getters into normal [MethodDeclaration]s. | 34 * [Refactoring] to convert getters into normal [MethodDeclaration]s. |
| 35 */ | 35 */ |
| 36 abstract class ConvertGetterToMethodRefactoring implements Refactoring { | 36 abstract class ConvertGetterToMethodRefactoring implements Refactoring { |
| 37 /** | 37 /** |
| 38 * Returns a new [ConvertMethodToGetterRefactoring] instance for converting | 38 * Returns a new [ConvertMethodToGetterRefactoring] instance for converting |
| 39 * [element] and all the corresponding hierarchy elements. | 39 * [element] and all the corresponding hierarchy elements. |
| 40 */ | 40 */ |
| 41 factory ConvertGetterToMethodRefactoring( | 41 factory ConvertGetterToMethodRefactoring( |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 String get methodName; | 271 String get methodName; |
| 272 } | 272 } |
| 273 | 273 |
| 274 /** | 274 /** |
| 275 * [Refactoring] to move/rename a file. | 275 * [Refactoring] to move/rename a file. |
| 276 */ | 276 */ |
| 277 abstract class MoveFileRefactoring implements Refactoring { | 277 abstract class MoveFileRefactoring implements Refactoring { |
| 278 /** | 278 /** |
| 279 * Returns a new [MoveFileRefactoring] instance. | 279 * Returns a new [MoveFileRefactoring] instance. |
| 280 */ | 280 */ |
| 281 factory MoveFileRefactoring(pathos.Context pathContext, | 281 factory MoveFileRefactoring(ResourceProvider resourceProvider, |
| 282 SearchEngine searchEngine, AnalysisContext context, Source source) { | 282 SearchEngine searchEngine, AnalysisContext context, Source source, |
| 283 String oldFile) { |
| 283 return new MoveFileRefactoringImpl( | 284 return new MoveFileRefactoringImpl( |
| 284 pathContext, searchEngine, context, source); | 285 resourceProvider, searchEngine, context, source, oldFile); |
| 285 } | 286 } |
| 286 | 287 |
| 287 /** | 288 /** |
| 288 * The new file path to which the given file is being moved. | 289 * The new file path to which the given file is being moved. |
| 289 */ | 290 */ |
| 290 void set newFile(String newName); | 291 void set newFile(String newName); |
| 291 } | 292 } |
| 292 | 293 |
| 293 /** | 294 /** |
| 294 * Abstract interface for all refactorings. | 295 * Abstract interface for all refactorings. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 * Validates that the [newName] is a valid identifier and is appropriate for | 400 * Validates that the [newName] is a valid identifier and is appropriate for |
| 400 * the type of the [Element] being renamed. | 401 * the type of the [Element] being renamed. |
| 401 * | 402 * |
| 402 * It does not perform all the checks (such as checking for conflicts with any | 403 * It does not perform all the checks (such as checking for conflicts with any |
| 403 * existing names in any of the scopes containing the current name), as many | 404 * existing names in any of the scopes containing the current name), as many |
| 404 * of these checkes require search engine. Use [checkFinalConditions] for this | 405 * of these checkes require search engine. Use [checkFinalConditions] for this |
| 405 * level of checking. | 406 * level of checking. |
| 406 */ | 407 */ |
| 407 RefactoringStatus checkNewName(); | 408 RefactoringStatus checkNewName(); |
| 408 } | 409 } |
| OLD | NEW |