From 4dbfb5b49a1af028e587f3419a5c0ae241d594c8 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 14 Sep 2025 06:25:03 -0400 Subject: [PATCH] docs: document the `@ignore` capture in tags --- docs/src/3-syntax-highlighting.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/3-syntax-highlighting.md b/docs/src/3-syntax-highlighting.md index b11a2e86..a74836ab 100644 --- a/docs/src/3-syntax-highlighting.md +++ b/docs/src/3-syntax-highlighting.md @@ -180,6 +180,9 @@ The capture names are as follows: - `@local.reference` — indicates that a syntax node contains the *name*, which *may* refer to an earlier definition within some enclosing scope. +Additionally, to ignore certain nodes from being tagged, you can use the `@ignore` capture. This is useful if you want +to run a predicate or directive on a node, but don't want it to be tagged. + When highlighting a file, Tree-sitter will keep track of the set of scopes that contains any given position, and the set of definitions within each scope. When processing a syntax node that is captured as a `local.reference`, Tree-sitter will try to find a definition for a name that matches the node's text. If it finds a match, Tree-sitter will ensure that the