namedChild method

TreeSitterNode? namedChild(
  1. int index
)

Implementation

TreeSitterNode? namedChild(int index) {
  if (index < 0) return null;
  var namedIndex = 0;
  for (var childIndex = 0; childIndex < children.length; childIndex++) {
    final candidate = _bindChild(childIndex);
    if (!candidate.isNamed) continue;
    if (namedIndex == index) return candidate;
    namedIndex++;
  }
  return null;
}