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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java

Issue 11364020: Issue 5722. Better 'missing part of' error message. Quick Fix for it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java
index 8a87b1e0a63dc22750bb066538f94ec774a19212..e18a955f951eba17bd9ac8efe6f11d7fe3495ec4 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java
@@ -13,13 +13,6 @@
*/
package com.google.dart.tools.ui.internal.text.correction;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_BINARY_EXPRESSION_LEFT_OPERAND;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_BINARY_EXPRESSION_RIGHT_OPERAND;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_RETURN_STATEMENT_VALUE;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_VARIABLE_NAME;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_VARIABLE_VALUE;
-import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.getLocationInParent;
-
import com.google.common.collect.Lists;
import com.google.dart.compiler.ast.ASTNodes;
import com.google.dart.compiler.ast.DartBinaryExpression;
@@ -73,6 +66,13 @@ import com.google.dart.tools.ui.text.dart.IInvocationContext;
import com.google.dart.tools.ui.text.dart.IProblemLocation;
import com.google.dart.tools.ui.text.dart.IQuickAssistProcessor;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_BINARY_EXPRESSION_LEFT_OPERAND;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_BINARY_EXPRESSION_RIGHT_OPERAND;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_RETURN_STATEMENT_VALUE;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_VARIABLE_NAME;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.DART_VARIABLE_VALUE;
+import static com.google.dart.tools.core.dom.PropertyDescriptorHelper.getLocationInParent;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.swt.graphics.Image;
@@ -168,20 +168,22 @@ public class QuickAssistProcessor implements IQuickAssistProcessor {
selectionLength = context.getSelectionLength();
selectionFunction = DartModelUtil.findFunction(unit, selectionOffset);
node = context.getCoveringNode();
- utils = new ExtractUtils(unit, (DartUnit) node.getRoot());
if (node != null) {
- boolean noErrorsAtLocation = noErrorsAtLocation(locations);
- if (noErrorsAtLocation) {
- // invoke each "addProposal_" method
- for (final Method method : QuickAssistProcessor.class.getDeclaredMethods()) {
- if (method.getName().startsWith("addProposal_")) {
- ExecutionUtils.runIgnore(new RunnableEx() {
- @Override
- public void run() throws Exception {
- method.invoke(QuickAssistProcessor.this);
- }
- });
- resetProposalElements();
+ utils = new ExtractUtils(unit, (DartUnit) node.getRoot());
+ if (node != null) {
+ boolean noErrorsAtLocation = noErrorsAtLocation(locations);
+ if (noErrorsAtLocation) {
+ // invoke each "addProposal_" method
+ for (final Method method : QuickAssistProcessor.class.getDeclaredMethods()) {
+ if (method.getName().startsWith("addProposal_")) {
+ ExecutionUtils.runIgnore(new RunnableEx() {
+ @Override
+ public void run() throws Exception {
+ method.invoke(QuickAssistProcessor.this);
+ }
+ });
+ resetProposalElements();
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698