[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
- feature/tree-sitter updated (59eaa30b07 -> ac9bc819bc), Yuan Fu, 2022/11/19
- feature/tree-sitter 655957087c 2/6: Expand css-ts-mode and merge it into css-mode, Yuan Fu, 2022/11/19
- feature/tree-sitter e41af3971d 1/6: Change tree-sitter indent preset 'match' to count on all nodes, Yuan Fu, 2022/11/19
- feature/tree-sitter 00df4566af 3/6: Split python-mode into native and tree-sitter variant, Yuan Fu, 2022/11/19
- feature/tree-sitter d6362b632e 4/6: Merge function/class-name features in python-mode,
Yuan Fu <=
- feature/tree-sitter ac9bc819bc 6/6: Fix tree-sitter comment indentation for C-like languages, Yuan Fu, 2022/11/19
- feature/tree-sitter 7d7e9ef46a 5/6: Separate native and tree-sitter variant of js-mode, Yuan Fu, 2022/11/19