coveringNode property

AstNode? get coveringNode
inherited

The most deeply nested node that completely covers the highlight region of the diagnostic, or null if there is no diagnostic or if such a node does not exist.

Implementation

AstNode? get coveringNode {
  if (_coveringNodeIsSet) {
    return _coveringNode;
  }

  _coveringNodeIsSet = true;
  var diagnostic = this.diagnostic;
  if (diagnostic == null) {
    return null;
  }
  var diagnosticOffset = diagnostic.problemMessage.offset;
  var diagnosticLength = diagnostic.problemMessage.length;
  return _coveringNode = unit.nodeCovering(
    offset: diagnosticOffset,
    length: diagnosticLength,
  );
}