aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorJostein Kjønigsen2025-03-20 10:39:31 +0100
committerEli Zaretskii2025-06-21 11:17:51 +0300
commit39721a4d79a6056e09f4d0996f1942eee8e34934 (patch)
treed2bac20d7eabdec09bcc11924ea278ee1c1acbb6 /lisp/progmodes/python.el
parent00b8d11ac8682749f15ac7125f54f357b8825d86 (diff)
downloademacs-39721a4d79a6056e09f4d0996f1942eee8e34934.tar.gz
emacs-39721a4d79a6056e09f4d0996f1942eee8e34934.zip
python-ts-mode: Improve fontification
python--treesit-settings: Fontification based on selectors & code-conventions - Constructor: Fontified as type, not function-call. - Typed default parameters - Fontify kwargs in function calls as property-use. Differentiate from variable-use (passed in arguments)
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 06cb5e3a8d5..568551f5734 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1237,6 +1237,7 @@ fontified."
1237 (parameters (identifier) @font-lock-variable-name-face) 1237 (parameters (identifier) @font-lock-variable-name-face)
1238 (parameters (typed_parameter (identifier) @font-lock-variable-name-face)) 1238 (parameters (typed_parameter (identifier) @font-lock-variable-name-face))
1239 (parameters (default_parameter name: (identifier) @font-lock-variable-name-face)) 1239 (parameters (default_parameter name: (identifier) @font-lock-variable-name-face))
1240 (parameters (typed_default_parameter name: (identifier) @font-lock-variable-name-face))
1240 (lambda_parameters (identifier) @font-lock-variable-name-face) 1241 (lambda_parameters (identifier) @font-lock-variable-name-face)
1241 (for_in_clause 1242 (for_in_clause
1242 left: (identifier) @font-lock-variable-name-face) 1243 left: (identifier) @font-lock-variable-name-face)
@@ -1267,7 +1268,11 @@ fontified."
1267 1268
1268 :feature 'function 1269 :feature 'function
1269 :language 'python 1270 :language 'python
1270 '((call function: (identifier) @font-lock-function-call-face) 1271 '(((call function: (identifier) @font-lock-type-face)
1272 (:match "\\`[A-Z][A-Za-z0-9]+\\'" @font-lock-type-face))
1273 (call function: (identifier) @font-lock-function-call-face)
1274 (call arguments: (argument_list (keyword_argument
1275 name: (identifier) @font-lock-property-name-face)))
1271 (call function: (attribute 1276 (call function: (attribute
1272 attribute: (identifier) @font-lock-function-call-face))) 1277 attribute: (identifier) @font-lock-function-call-face)))
1273 1278