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:
parent
dc720decc3
commit
afd0b548fc
1 changed files with 9 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue