mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
This allows duplicating a query so that it can be modified by using disable_capture or disable_pattern, without re-parsing the query. The new `ts_query_copy` creates a deep copy of the entire query object. A motivation for this is tags.scm code navigation queries. You might want to have one version of the compiled query capture only definitions and the other only capture references, since references are much much more common than definitions in a typical codebase. Instead of re-parsing and analyzing the query and then calling `ts_query_disable_capture`, we can clone the built query all-at-once and then disable captures / patterns. |
||
|---|---|---|
| .. | ||
| api.h | ||