diff options
author | Yuan Fu <casouri@gmail.com> | 2022-11-19 16:10:46 -0800 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-11-19 16:10:46 -0800 |
commit | d6362b632e3c76cb55a05248aa221e426c5adb5a (patch) | |
tree | 81bf98c38a3bcd2386f309d4ea24ba9063945bb9 | |
parent | 00df4566af9dff0a27fd6da566ef1e53268a6d47 (diff) | |
download | emacs-d6362b632e3c76cb55a05248aa221e426c5adb5a.tar.gz emacs-d6362b632e3c76cb55a05248aa221e426c5adb5a.tar.bz2 emacs-d6362b632e3c76cb55a05248aa221e426c5adb5a.zip |
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.
-rw-r--r-- | lisp/progmodes/python.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 01a6887bb6e..456f141960e 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 |