Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1040)

Unified Diff: pkg/analysis_server/lib/src/edit/edit_domain.dart

Issue 589843002: Reset refactoring manager on any analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f912d5163b20a01dbd93c676d3441b877fe8efe7..4f40bbaef26b800d2340432bf63af1c2612697ae 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -180,6 +180,8 @@ class _RefactoringManager {
EditGetRefactoringResult result;
_RefactoringManager(this.server, this.searchEngine) {
+ server.addAnalysisServerListener(
+ new _ResetRefactoringManagerAnalysisServerListener(this));
_reset();
}
@@ -362,6 +364,9 @@ class _RefactoringManager {
}
void _reset() {
+ kind = null;
+ offset = null;
+ length = null;
refactoring = null;
feedback = null;
initStatus = new RefactoringStatus();
@@ -426,3 +431,24 @@ class _RefactoringManager {
return new RefactoringStatus();
}
}
+
+
+/**
+ * A [AnalysisServerListener] that resets [_RefactoringManager] when analysis
+ * is started in the [AnalysisServer].
+ */
+class _ResetRefactoringManagerAnalysisServerListener implements
+ AnalysisServerListener {
+ final _RefactoringManager refactoringManager;
+
+ _ResetRefactoringManagerAnalysisServerListener(this.refactoringManager);
+
+ @override
+ void analysisComplete() {
+ }
+
+ @override
+ void analysisStarted(engine.AnalysisContext context) {
+ refactoringManager._reset();
+ }
+}
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698