GNU bug report logs - #67061
[PATCH] Improve syntax highlighting for python-ts-mode

Previous Next

Package: emacs;

Reported by: Denis Zubarev <dvzubarev <at> yandex.ru>

Date: Sat, 11 Nov 2023 02:23:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Denis Zubarev <dvzubarev <at> yandex.ru>, Yuan Fu <casouri <at> gmail.com>
Cc: 67061 <at> debbugs.gnu.org
Subject: bug#67061: [PATCH] Improve syntax highlighting for python-ts-mode
Date: Sat, 11 Nov 2023 09:32:48 +0200
> From: Denis Zubarev <dvzubarev <at> yandex.ru>
> Date: Sat, 11 Nov 2023 05:21:25 +0300
> 
> Improve syntax highlighting for python-ts-mode.
> 
> - Fontify compound keywords "not in" and "is not" (fixes bug#67015)
> - Fix fontification of strings inside of f-strings interpolation,
>    e.g. for f"beg {'nested'}" - 'nested' was not fontified as string.
> - Do not override the face of builtin functions (all, bytes etc.) with
>   the function call face
> - Add missing assignment expressions
> - Fontify built-ins (dict,list,etc.) as types when they are used in type hints

Yuan, any comments?

My only comment is that we should decide in which fontification
level(s) should the additional fontifications be.

> I have added tests to treesit-tests.el, but I'm not sure that it is the
> right place for them. I tried to create new file
> python-ts-mode-tests.el, but when I run tests using make, I got
> an error:
> *** No rule to make target '../lisp/progmodes/python-ts-mode.el', needed by 'lisp/progmodes/python-ts-mode-tests.log'.  Stop.
> 
> It seems that python-ts-mode is required to be in its own file, but it
> is defined in python.el.
> Adding tests to python-tests.el seems like not good idea too, because
> some CI code is searching for *-ts-mode-tests.el or treesit-tests.el files.

The tests should be in python-tests.el, and should be skipped if
(treesit-ready-p 'python t) returns nil.

What problems with CI did you see?  I don't think I understand your
last sentence above.

> >From 0b3165eb90bdc1b85688d3c9a1902c1f293972d1 Mon Sep 17 00:00:00 2001
> From: Denis Zubarev <dvzubarev <at> yandex.ru>
> Date: Sat, 11 Nov 2023 04:55:44 +0300
> Subject: [PATCH] Improve syntax highlighting for python-ts-mode

This submission is too large for us to accept without a copyright
assignment.  Would you like to start your assignment copyright
paperwork rolling at this time?  If yes, I will send you the form to
fill and the instructions to email it.

Thanks.




This bug report was last modified 1 year and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.