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.
This commit is contained in:
Prateek Sharma 2024-04-20 02:06:17 +05:30 committed by Yuan Fu
parent dc720decc3
commit afd0b548fc
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -1187,13 +1187,15 @@ fontified."
:feature 'builtin
:language 'python
`(((identifier) @font-lock-builtin-face
(:match ,(rx-to-string
`(seq bol
(or ,@python--treesit-builtins
,@python--treesit-special-attributes)
eol))
@font-lock-builtin-face)))
`((call function: (identifier) @font-lock-builtin-face
(:match ,(rx-to-string
`(seq bol (or ,@python--treesit-builtins) eol))
@font-lock-builtin-face))
(attribute attribute: (identifier) @font-lock-builtin-face
(:match ,(rx-to-string
`(seq bol
(or ,@python--treesit-special-attributes) eol))
@font-lock-builtin-face)))
:feature 'decorator
:language 'python