diff options
| author | Prateek Sharma | 2024-04-20 02:06:17 +0530 |
|---|---|---|
| committer | Yuan Fu | 2024-04-21 16:37:15 -0700 |
| commit | afd0b548fcc5e141528a442ff9100fe8e2b98f21 (patch) | |
| tree | a98fea86c2f8e4b7222e4d2c7457dfadaa8e9ef4 /lisp/progmodes/python.el | |
| parent | dc720decc3a7f0cfaaaf4467c0c5d2954dec527c (diff) | |
| download | emacs-afd0b548fcc5e141528a442ff9100fe8e2b98f21.tar.gz emacs-afd0b548fcc5e141528a442ff9100fe8e2b98f21.zip | |
Fix python-ts-mode built-in functions and attributes (bug#70478)
* lisp/progmodes/python.el (python--treesit-settings): Change the
treesitter query to fetch the correct type of node for built-in
functions and attributes and highlight them with corresponding
font-lock face.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9849fde8588..02588d756e9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1187,13 +1187,15 @@ fontified." | |||
| 1187 | 1187 | ||
| 1188 | :feature 'builtin | 1188 | :feature 'builtin |
| 1189 | :language 'python | 1189 | :language 'python |
| 1190 | `(((identifier) @font-lock-builtin-face | 1190 | `((call function: (identifier) @font-lock-builtin-face |
| 1191 | (:match ,(rx-to-string | 1191 | (:match ,(rx-to-string |
| 1192 | `(seq bol | 1192 | `(seq bol (or ,@python--treesit-builtins) eol)) |
| 1193 | (or ,@python--treesit-builtins | 1193 | @font-lock-builtin-face)) |
| 1194 | ,@python--treesit-special-attributes) | 1194 | (attribute attribute: (identifier) @font-lock-builtin-face |
| 1195 | eol)) | 1195 | (:match ,(rx-to-string |
| 1196 | @font-lock-builtin-face))) | 1196 | `(seq bol |
| 1197 | (or ,@python--treesit-special-attributes) eol)) | ||
| 1198 | @font-lock-builtin-face))) | ||
| 1197 | 1199 | ||
| 1198 | :feature 'decorator | 1200 | :feature 'decorator |
| 1199 | :language 'python | 1201 | :language 'python |