Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Expression.java |
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Expression.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Expression.java |
index 18c290dfca6596e1f7e89147a87b780b40021174..904e9552fa7b6821d66a97759cb2472985444af0 100644 |
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Expression.java |
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Expression.java |
@@ -55,8 +55,20 @@ public abstract class Expression extends ASTNode { |
if (parent instanceof ArgumentList) { |
return ((ArgumentList) parent).getParameterElementFor(this); |
} |
- // TODO(brianwilkerson) Consider implementing this method for children of BinaryExpression, |
- // IndexExpression, PrefixExpression, and PostfixExpression. |
+ if (parent instanceof IndexExpression) { |
+ IndexExpression indexExpression = (IndexExpression) parent; |
+ if (indexExpression.getIndex() == this) { |
+ return indexExpression.getParameterElementForIndex(); |
+ } |
+ } |
+ if (parent instanceof BinaryExpression) { |
+ BinaryExpression binaryExpression = (BinaryExpression) parent; |
+ if (binaryExpression.getRightOperand() == this) { |
+ return binaryExpression.getParameterElementForRightOperand(); |
+ } |
+ } |
+ // TODO(brianwilkerson) Consider implementing this method for children of PrefixExpression |
+ // and PostfixExpression. |
return null; |
} |