Index: pkg/analysis_server/lib/src/edit/edit_domain.dart |
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart |
index 70ce1d33a3772decb59516f7a2395fa70e4e6d9b..26e3ff728abe8fb0b1397d267e38cb9fc4204e4c 100644 |
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart |
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart |
@@ -357,11 +357,22 @@ class _RefactoringManager { |
} |
/** |
- * Initializes this context to perform a refactoring with the specified |
- * parameters. The existing [Refactoring] is reused or created as needed. |
+ * Awaits for analysis to complete and then calls [_init2] to actually |
+ * initialize the resfactoring. |
*/ |
Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset, |
int length) { |
+ return server.onAnalysisComplete.then((_) { |
Paul Berry
2015/01/26 22:32:11
As we discussed in person, it would be nice in a f
|
+ return _init2(kind, file, offset, length); |
+ }); |
+ } |
+ |
+ /** |
+ * Initializes this context to perform a refactoring with the specified |
+ * parameters. The existing [Refactoring] is reused or created as needed. |
+ */ |
+ Future<RefactoringStatus> _init2(RefactoringKind kind, String file, |
+ int offset, int length) { |
// check if we can continue with the existing Refactoring instance |
if (this.kind == kind && |
this.file == file && |