]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge function/class-name features in python-mode
authorYuan Fu <casouri@gmail.com>
Sun, 20 Nov 2022 00:10:46 +0000 (16:10 -0800)
committerYuan Fu <casouri@gmail.com>
Sun, 20 Nov 2022 00:10:46 +0000 (16:10 -0800)
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

index 01a6887bb6e85d51446cb0dd7b9549a9e40d5d12..456f141960ea43db97b9655429e93886a3da9231 100644 (file)
@@ -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