emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/tree-sitter b440fa0a6b 1/4: ; Elaborate on tree-sitter fontifica


From: Yuan Fu
Subject: feature/tree-sitter b440fa0a6b 1/4: ; Elaborate on tree-sitter fontification features documentation
Date: Thu, 17 Nov 2022 13:26:18 -0500 (EST)

branch: feature/tree-sitter
commit b440fa0a6b48a95323fa922b88e9a9a73d6c6360
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Elaborate on tree-sitter fontification features documentation
    
    * doc/lispref/modes.texi (Parser-based Font Lock)
    * lisp/treesit.el (treesit-font-lock-feature-list): Explain in more
    detail, and change some features.
---
 doc/lispref/modes.texi | 19 ++++++++++++++-----
 lisp/treesit.el        | 10 +++++-----
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 71687b0783..8b20bc0b75 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -4077,11 +4077,20 @@ Each element of the list is a list of the form 
@w{@code{(@var{feature}
 list disables the corresponding query during font-lock.
 
 Common feature names, for many programming languages, include
-function-name, type, variable-name (left-hand-side or @acronym{LHS} of
-assignments), builtin, constant, keyword, string-interpolation,
-comment, doc, string, operator, preprocessor, escape-sequence, and key
-(in key-value pairs).  Major modes are free to subdivide or extend
-these common features.
+@code{definition}, @code{type}, @code{assignment}, @code{builtin},
+@code{constant}, @code{keyword}, @code{string-interpolation},
+@code{comment}, @code{doc}, @code{string}, @code{operator},
+@code{preprocessor}, @code{escape-sequence}, and @code{key}.  Major
+modes are free to subdivide or extend these common features.
+
+Some of these features warrant some explanation: @code{definition}
+highlights whatever is being defined, e.g., the function name in a
+function definition, the struct name in a struct definition, the
+variable name in a variable definition; @code{assignment} highlights
+the whatever is being assigned to, e.g., the variable or field in an
+assignment statement; @code{key} highlights keys in key-value pairs,
+e.g., keys in a JSON object, or a Python dictionary; @code{doc}
+highlights docstrings or doc-comments.
 
 For example, the value of this variable could be:
 @example
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 1284afe84b..6a41c1a411 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -542,11 +542,11 @@ Removing a feature symbol from this list disables the
 corresponding query during font-lock.
 
 Common feature names (for general programming languages) include
-function-name, type, variable-name (LHS of assignments), builtin,
-constant, keyword, string-interpolation, comment, doc, string,
-operator, preprocessor, escape-sequence, key (in key-value
-pairs).  Major modes are free to subdivide or extend on these
-common features.
+definition, type, assignment, builtin, constant, keyword,
+string-interpolation, comment, doc, string, operator, property,
+preprocessor, escape-sequence, key (in key-value pairs).  Major
+modes are free to subdivide or extend on these common features.
+See the manual for more explanations on some of the feature.
 
 For changes to this variable to take effect, run
 `treesit-font-lock-recompute-features'.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]