Variable: treesit-range-settings

treesit-range-settings is a buffer-local variable defined in treesit.el.gz.

Documentation

A list of range settings.

Each element of the list is of the form (QUERY LANGUAGE LOCAL-P OFFSET). When updating the range of each parser in the buffer, treesit-update-ranges queries each QUERY, and sets LANGUAGE's range to the range spanned by captured nodes. QUERY must be a compiled query. If LOCAL-P is t, give each range a separate local parser rather than using a single parser for all the ranges. If OFFSET is non-nil, it should be a cons of numbers (START-OFFSET . END-OFFSET), where the start and end offset are added to each queried range to get the result ranges.

Capture names generally don't matter, but names that starts with an underscore are ignored.

QUERY can also be a function, in which case it is called with 2 arguments, START and END. It should ensure parsers' ranges are correct in the region between START and END.

The exact form of each setting is considered internal and subject to change. Use treesit-range-rules to set this variable.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
;;; Range API supplement

(defvar-local treesit-range-settings nil
  "A list of range settings.

Each element of the list is of the form (QUERY LANGUAGE LOCAL-P
OFFSET).  When updating the range of each parser in the buffer,
`treesit-update-ranges' queries each QUERY, and sets LANGUAGE's
range to the range spanned by captured nodes.  QUERY must be a
compiled query.  If LOCAL-P is t, give each range a separate
local parser rather than using a single parser for all the
ranges.  If OFFSET is non-nil, it should be a cons of
numbers (START-OFFSET . END-OFFSET), where the start and end
offset are added to each queried range to get the result ranges.

Capture names generally don't matter, but names that starts with
an underscore are ignored.

QUERY can also be a function, in which case it is called with 2
arguments, START and END.  It should ensure parsers' ranges are
correct in the region between START and END.

The exact form of each setting is considered internal and subject
to change.  Use `treesit-range-rules' to set this variable.")