summaryrefslogtreecommitdiff
path: root/lisp/treesit.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2023-02-05 15:46:28 +0200
committerDmitry Gutov <dgutov@yandex.ru>2023-02-05 15:50:16 +0200
commit0c125fcc67a47b933716124223404a45e73357c7 (patch)
treee2ebb0d44dd108f4efbc4b02dc3110c18e95f625 /lisp/treesit.el
parent1dd751c3ac4e4276b461b83df7d9c4d002cf016e (diff)
downloademacs-0c125fcc67a47b933716124223404a45e73357c7.tar.gz
emacs-0c125fcc67a47b933716124223404a45e73357c7.tar.bz2
emacs-0c125fcc67a47b933716124223404a45e73357c7.zip
Make highlighting more regular across TS modes (bug#61205)
* doc/emacs/display.texi (Parser-based Font Lock): Update description of treesit-font-lock-level, moving 'property' to level 4. * lisp/treesit.el (treesit-font-lock-level): Likewise, in docstring. * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Do that here. * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode): Add a comment. * lisp/progmodes/go-ts-mode.el (go-ts-mode): Add 'definition' to level 1. Move 'function', 'property' and 'variable' to level 4. (go-ts-mode--font-lock-settings): Move a bunch of existing rules to 'definition'. Add highlighting of function parameters. * lisp/progmodes/rust-ts-mode.el (rust-ts-mode) (rust-ts-mode--font-lock-settings): Same. And also change "scoped identifiers" highlights to only match capitalized names.
Diffstat (limited to 'lisp/treesit.el')
-rw-r--r--lisp/treesit.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 7e31da95ef4..7bd68c9a6d9 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -612,9 +612,10 @@ fontifications.
Level 1 usually contains only comments and definitions.
Level 2 usually adds keywords, strings, data types, etc.
Level 3 usually represents full-blown fontifications, including
-assignments, constants, numbers and literals, properties, etc.
+assignments, constants, numbers and literals, etc.
Level 4 adds everything else that can be fontified: delimiters,
-operators, brackets, punctuation, all functions and variables, etc.
+operators, brackets, punctuation, all functions, properties,
+variables, etc.
In addition to the decoration level, individual features can be
turned on/off by calling `treesit-font-lock-recompute-features'.