searchWithin method

AstNode searchWithin (
  1. AstNode node
)

Search within the given AST node for an identifier representing an element in the specified source range. Return the element that was found, or null if no element was found.

Implementation

AstNode searchWithin(AstNode node) {
  if (node == null) {
    return null;
  }
  try {
    node.accept(this);
  } catch (exception, stackTrace) {
    // TODO(39284): should this exception be silent?
    AnalysisEngine.instance.instrumentationService.logException(
        SilentException(
            "Unable to locate element at offset ($_startOffset - $_endOffset)",
            exception,
            stackTrace));
    return null;
  }
  return _foundNode;
}