mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Add font-locking for typed parameters in python-ts-mode (bug#70665)
* lisp/progmodes/python.el (python--treesit-settings): Add tree-sitter font-locking rule for typed parameters. * test/lisp/progmodes/python-tests.el (python-ts-mode-types-face-1): Test for font-lock-variable-name-face in typed parameter.
This commit is contained in:
parent
b84fa71f89
commit
0f92d433d2
2 changed files with 4 additions and 0 deletions
|
|
@ -1202,6 +1202,7 @@ fontified."
|
|||
(class_definition
|
||||
name: (identifier) @font-lock-type-face)
|
||||
(parameters (identifier) @font-lock-variable-name-face)
|
||||
(parameters (typed_parameter (identifier) @font-lock-variable-name-face))
|
||||
(parameters (default_parameter name: (identifier) @font-lock-variable-name-face)))
|
||||
|
||||
:feature 'builtin
|
||||
|
|
|
|||
|
|
@ -7545,6 +7545,9 @@ always located at the beginning of buffer."
|
|||
(ert-deftest python-ts-mode-types-face-1 ()
|
||||
(python-ts-tests-with-temp-buffer
|
||||
"def f(val: Callable[[Type0], (Type1, Type2)]):"
|
||||
(search-forward "val")
|
||||
(goto-char (match-beginning 0))
|
||||
(should (eq (face-at-point) font-lock-variable-name-face))
|
||||
(dolist (test '("Callable" "Type0" "Type1" "Type2"))
|
||||
(search-forward test)
|
||||
(goto-char (match-beginning 0))
|
||||
|
|
|
|||
Loading…
Reference in a new issue