Chromium Code Reviews| Index: pkg/analysis_services/lib/refactoring/refactoring.dart |
| diff --git a/pkg/analysis_services/lib/refactoring/refactoring.dart b/pkg/analysis_services/lib/refactoring/refactoring.dart |
| index f8a8ee71849df9ed596a839a0afcf33c266d46c7..1516f1a24461f886960da40013a14f9f9e9f5c5c 100644 |
| --- a/pkg/analysis_services/lib/refactoring/refactoring.dart |
| +++ b/pkg/analysis_services/lib/refactoring/refactoring.dart |
| @@ -4,6 +4,8 @@ |
| library services.refactoring; |
| +import 'dart:async'; |
| + |
| import 'package:analysis_services/correction/change.dart'; |
| import 'package:analysis_services/correction/status.dart'; |
| import 'package:analysis_services/search/search_engine.dart'; |
| @@ -24,26 +26,26 @@ abstract class Refactoring { |
| * Checks all conditions - [checkInitialConditions] and |
| * [checkFinalConditions] to decide if refactoring can be performed. |
| */ |
| - RefactoringStatus checkAllConditions(); |
| + Future<RefactoringStatus> checkAllConditions(); |
|
Brian Wilkerson
2014/08/12 04:44:40
Is it really necessary to make refactorings async?
scheglov
2014/08/12 05:09:33
Unfortunately yes.
SearchEngine is async, and it i
|
| /** |
| * Validates environment to check if this refactoring can be performed. |
| * |
| * This check may be slow, because many refactorings use search engine. |
| */ |
| - RefactoringStatus checkFinalConditions(); |
| + Future<RefactoringStatus> checkFinalConditions(); |
| /** |
| * Validates arguments to check if this refactoring can be performed. |
| * |
| * This check should be quick because it is used often as arguments change. |
| */ |
| - RefactoringStatus checkInitialConditions(); |
| + Future<RefactoringStatus> checkInitialConditions(); |
| /** |
| * Returns the [Change] to apply to perform this refactoring. |
| */ |
| - Change createChange(); |
| + Future<Change> createChange(); |
| /** |
| * Returs `true` if the [Change] created by refactoring may be unsafe, |