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

Unified Diff: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java

Issue 587743002: Version 1.7.0-dev.3.2 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/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
Index: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (revision 40507)
+++ editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (working copy)
@@ -228,7 +228,11 @@
// call proposal methods
addUnresolvedProposal_addPart();
// done
- return proposals.toArray(new CorrectionProposal[proposals.size()]);
+ try {
+ return proposals.toArray(new CorrectionProposal[proposals.size()]);
+ } finally {
+ cleanUp();
+ }
}
@Override
@@ -285,6 +289,7 @@
return proposals.toArray(new CorrectionProposal[proposals.size()]);
} finally {
instrumentation.log();
+ cleanUp();
}
}
@@ -1268,15 +1273,6 @@
addUnitCorrectionProposal(QA_SPLIT_VARIABLE_DECLARATION);
}
-// private void addLinkedPositionProposal(String group, CorrectionImage icon, String text) {
-// List<TrackedNodeProposal> nodeProposals = linkedPositionProposals.get(group);
-// if (nodeProposals == null) {
-// nodeProposals = Lists.newArrayList();
-// linkedPositionProposals.put(group, nodeProposals);
-// }
-// nodeProposals.add(new TrackedNodeProposal(icon, text));
-// }
-
void addProposal_surroundWith() throws Exception {
// prepare selected statements
List<Statement> selectedStatements;
@@ -1545,6 +1541,15 @@
}
}
+// private void addLinkedPositionProposal(String group, CorrectionImage icon, String text) {
+// List<TrackedNodeProposal> nodeProposals = linkedPositionProposals.get(group);
+// if (nodeProposals == null) {
+// nodeProposals = Lists.newArrayList();
+// linkedPositionProposals.put(group, nodeProposals);
+// }
+// nodeProposals.add(new TrackedNodeProposal(icon, text));
+// }
+
private void addInsertEdit(int offset, String text) {
textEdits.add(createInsertEdit(offset, text));
}
@@ -1678,6 +1683,24 @@
}
}
+ private void cleanUp() {
+ proposals.clear();
+ textEdits.clear();
+ positionStopEdits.clear();
+ linkedPositions.clear();
+ linkedPositionProposals.clear();
+ assistContext = null;
+ analysisContext = null;
+ source = null;
+ unit = null;
+ node = null;
+ unitLibrarySource = null;
+ unitLibraryElement = null;
+ unitLibraryFile = null;
+ unitLibraryFolder = null;
+ utils = null;
+ }
+
private Edit createInsertEdit(int offset, String text) {
return new Edit(offset, 0, text);
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTestCase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698