Example #1
0
 @Override
 public Void visitUnaryExpression(DartUnaryExpression node) {
   super.visitUnaryExpression(node);
   if (foundElement == null) {
     int start = node.getSourceInfo().getOffset();
     int end = start + node.getSourceInfo().getLength();
     if (start <= startOffset && endOffset <= end) {
       DartExpression operand = node.getArg();
       wordRegion = computeOperatorRegion(start, operand.getSourceInfo().getOffset() - 1);
       Element targetSymbol = node.getElement();
       findElementFor(targetSymbol);
       throw new DartElementFoundException();
     }
   }
   return null;
 }
Example #2
0
 @Override
 public Void visitArrayAccess(DartArrayAccess node) {
   super.visitArrayAccess(node);
   if (foundElement == null) {
     int start = node.getSourceInfo().getOffset();
     int end = start + node.getSourceInfo().getLength();
     if (start <= startOffset && endOffset <= end) {
       DartExpression target = node.getTarget();
       wordRegion =
           new Region(
               target.getSourceInfo().getOffset() + target.getSourceInfo().getLength(), end);
       Element targetElement = node.getElement();
       findElementFor(targetElement);
       throw new DartElementFoundException();
     }
   }
   return null;
 }