docs(queries): clarify behavior of first child anchor example

(cherry picked from commit b53a0fe622)
This commit is contained in:
Will Lillis 2026-06-30 00:24:11 -04:00
parent 77b741bb83
commit fa6222a0d3

View file

@ -180,7 +180,7 @@ depending on where it's placed inside a query.
When `.` is placed before the _first_ child within a parent pattern, the child will only match when it is the first named
node in the parent. For example, the below pattern matches a given `array` node at most once, assigning the `@the-element`
capture to the first `identifier` node in the parent `array`:
capture to the first node in the parent `array`, only if it's an `identifier` node:
```query
(array . (identifier) @the-element)