emacs-diffs
[Top][All Lists]
Advanced

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

feature/tree-sitter d6362b632e 4/6: Merge function/class-name features i


From: Yuan Fu
Subject: feature/tree-sitter d6362b632e 4/6: Merge function/class-name features in python-mode
Date: Sat, 19 Nov 2022 21:36:26 -0500 (EST)

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

    Merge function/class-name features in python-mode
    
    To keep consistency with other tree-sitter major modes.
    
    * lisp/progmodes/python.el (python--treesit-settings)
    (python-ts-mode): Merge function-name and class-name features into
    definition.
---
 lisp/progmodes/python.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 01a6887bb6..456f141960 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1049,14 +1049,11 @@ fontified."
    :override t
    '((interpolation (identifier) @font-lock-variable-name-face))
 
-   :feature 'function-name
+   :feature 'definition
    :language 'python
    '((function_definition
-      name: (identifier) @font-lock-function-name-face))
-
-   :feature 'class-name
-   :language 'python
-   '((class_definition
+      name: (identifier) @font-lock-function-name-face)
+     (class_definition
       name: (identifier) @font-lock-type-face))
 
    :feature 'keyword
@@ -6597,7 +6594,7 @@ implementations: `python-mode' and `python-ts-mode'."
   (when (treesit-ready-p 'python-mode 'python)
     (treesit-parser-create 'python)
     (setq-local treesit-font-lock-feature-list
-                '(( comment string function-name class-name)
+                '(( comment string definition)
                   ( keyword builtin constant type)
                   ( assignment decorator escape-sequence
                     string-interpolation number property



reply via email to

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