diff options
| author | Noah Peart | 2024-04-30 02:55:18 -0700 |
|---|---|---|
| committer | Yuan Fu | 2024-05-01 21:26:29 -0700 |
| commit | 0f92d433d2b806eb58a9a4c0197344b08ea5ae65 (patch) | |
| tree | ac37a8fea44d120caf1cebb604b08ef099aa189d /test/lisp/progmodes/python-tests.el | |
| parent | b84fa71f8985284560bacda7d407e3559583844f (diff) | |
| download | emacs-0f92d433d2b806eb58a9a4c0197344b08ea5ae65.tar.gz emacs-0f92d433d2b806eb58a9a4c0197344b08ea5ae65.zip | |
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.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index e11440cdb5b..878f60f1614 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -7545,6 +7545,9 @@ always located at the beginning of buffer." | |||
| 7545 | (ert-deftest python-ts-mode-types-face-1 () | 7545 | (ert-deftest python-ts-mode-types-face-1 () |
| 7546 | (python-ts-tests-with-temp-buffer | 7546 | (python-ts-tests-with-temp-buffer |
| 7547 | "def f(val: Callable[[Type0], (Type1, Type2)]):" | 7547 | "def f(val: Callable[[Type0], (Type1, Type2)]):" |
| 7548 | (search-forward "val") | ||
| 7549 | (goto-char (match-beginning 0)) | ||
| 7550 | (should (eq (face-at-point) font-lock-variable-name-face)) | ||
| 7548 | (dolist (test '("Callable" "Type0" "Type1" "Type2")) | 7551 | (dolist (test '("Callable" "Type0" "Type1" "Type2")) |
| 7549 | (search-forward test) | 7552 | (search-forward test) |
| 7550 | (goto-char (match-beginning 0)) | 7553 | (goto-char (match-beginning 0)) |