addRegion abstract method

void addRegion(
  1. int offset,
  2. int length,
  3. ElementKind targetKind,
  4. Location targetNameLocation, {
  5. Element? targetElement,
})

Record a new navigation region with the given offset and length that should navigate to the given targetNameLocation.

In the most cases the targetNameLocation is already based on the targetElement, but in a few cases this method is invoked without an element. The element is provided to associate it with the target, and later update the target.

Implementation

void addRegion(int offset, int length, ElementKind targetKind,
    Location targetNameLocation,
    {analyzer.Element? targetElement});