Variable: treesit-font-lock-settings

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

Documentation

A list of SETTINGs for treesit-based fontification.

Use treesit-font-lock-rules to set this variable. The exact format of each individual SETTING is considered internal and will change in the future. Use treesit-font-lock-setting-query, treesit-font-lock-setting-enable, etc, to access each field.

Below information is considered internal and only provided to help debugging:

Currently each SETTING has the form:

    (QUERY ENABLE FEATURE OVERRIDE REVERSE LANGUAGE)

QUERY is a tree-sitter query in either string, sexp, or compiled form.

For SETTING to be activated for font-lock, ENABLE must be t. To disable this SETTING, set ENABLE to nil.

FEATURE is the "feature name" of the query. Users can control which features are enabled with treesit-font-lock-level and treesit-font-lock-feature-list.

OVERRIDE is the override flag for this query. Its value can be t, nil, append, prepend, keep. See more in treesit-font-lock-rules.

If REVERSED is t, enable the QUERY when FEATURE is not in the feature list.

LANGUAGE is the language of QUERY.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defvar-local treesit-font-lock-settings nil
  "A list of SETTINGs for treesit-based fontification.

Use `treesit-font-lock-rules' to set this variable.  The exact format of
each individual SETTING is considered internal and will change in the
future.  Use `treesit-font-lock-setting-query',
`treesit-font-lock-setting-enable', etc, to access each field.

Below information is considered internal and only provided to help
debugging:

Currently each SETTING has the form:

    (QUERY ENABLE FEATURE OVERRIDE REVERSE LANGUAGE)

QUERY is a tree-sitter query in either string, sexp, or compiled form.

For SETTING to be activated for font-lock, ENABLE must be t.  To
disable this SETTING, set ENABLE to nil.

FEATURE is the \"feature name\" of the query.  Users can control
which features are enabled with `treesit-font-lock-level' and
`treesit-font-lock-feature-list'.

OVERRIDE is the override flag for this query.  Its value can be
t, nil, append, prepend, keep.  See more in
`treesit-font-lock-rules'.

If REVERSED is t, enable the QUERY when FEATURE is not in the feature
list.

LANGUAGE is the language of QUERY.")