Skip to content

Commit b9788eb

Browse files
authored
Merge pull request github#5568 from shati-patel/docs-binding-sets
Docs: Mention that binding sets are available for classes
2 parents 6492869 + fb004ba commit b9788eb

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/codeql/ql-language-reference/annotations.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,21 +385,23 @@ For more information, see ":ref:`monotonic-aggregates`."
385385
Binding sets
386386
============
387387

388-
**Available for**: |characteristic predicates|, |member predicates|, |non-member predicates|
388+
**Available for**: |classes|, |characteristic predicates|, |member predicates|, |non-member predicates|
389389

390390
``bindingset[...]``
391391
-------------------
392392

393-
You can use this annotation to explicitly state the binding sets for a predicate. A binding set
394-
is a subset of the predicate's arguments such that, if those arguments are constrained to a
395-
finite set of values, then the predicate itself is finite (that is, it evaluates to a finite
393+
You can use this annotation to explicitly state the binding sets for a predicate or class. A binding set
394+
is a subset of a predicate's or class body's arguments such that, if those arguments are constrained to a
395+
finite set of values, then the predicate or class itself is finite (that is, it evaluates to a finite
396396
set of tuples).
397397

398-
The ``bindingset`` annotation takes a comma-separated list of variables. Each variable must be
399-
an argument of the predicate, possibly including ``this`` (for characteristic predicates and
400-
member predicates) and ``result`` (for predicates that return a result).
398+
The ``bindingset`` annotation takes a comma-separated list of variables.
401399

402-
For more information, see ":ref:`predicate-binding`."
400+
- When you annotate a predicate, each variable must be an argument of the predicate, possibly including ``this``
401+
(for characteristic predicates and member predicates) and ``result`` (for predicates that return a result).
402+
For more information, see ":ref:`predicate-binding`."
403+
- When you annotate a class, each variable must be ``this`` or a field in the class.
404+
Binding sets for classes are supported from release 2.3.0 of the CodeQL CLI, and release 1.26 of LGTM Enterprise.
403405

404406
.. Links to use in substitutions
405407

0 commit comments

Comments
 (0)