Hey, Thanks for reviewing my changes.Here is the patch for reformatted version of the above fix. I've also removed the announcement in the NEWS file.On Sat, Apr 20, 2024 at 11:43 AM Eli Zaretskii <eliz@gnu.org> wrote:> From: Prateek Sharma <ps.prateek.sharma143@gmail.com>
> Date: Sat, 20 Apr 2024 02:30:17 +0530
>
> I do a lot of programming in python and have noticed that if there is a
> method of a class defined with the same name as a builtin function. It
> gets highlighted with the face for builtin functions and it looks
> different for all the other functions and confuses me sometimes and just
> looks inconsistent.
>
> I have made a simple fix to the treesitter query and it seems to have
> fixed the problem.
>
> Please share you thoughts on this fix. This is my first time
> contributing to an open-source project and to emacs. Very excited to
> hear from you guys!!!
Thanks. Yuan, any comments?
I have a few minor comments below.
> diff --git a/etc/NEWS b/etc/NEWS
> index 8ad1e78ca60..e5cd70b6106 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1319,6 +1319,15 @@ instead of:
> This allows the user to specify command line arguments to the non
> interactive Python interpreter specified by 'python-interpreter'.
>
> +*** Treesitter syntax highlighting for built-in functions fixed
> +The fix highlights only the correct built-in function calls and
> +attributes with font-lock-builtin-face. When some class defines
> +a function with the same name as a built-in function, earlier it was
> +being highlighted with the same font-lock-builtin-face, which was
> +incorrect. Now, normal user defined functions will be highlighted
> +with font-lock-function-call-face face and built-in functions and
> +attributes will be highlighted with font-lock-builtin-face.
This part is not needed, I think: we don't document bugfixes in NEWS.
> + `((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)))
Please reformat the whitespace here to avoid exceeding 80 columns in
each individual line.