From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#67061: [PATCH] Improve syntax highlighting for python-ts-mode Date: Sun, 10 Dec 2023 22:53:58 -0800 Message-ID: <6752e286-618e-4fcd-a210-14090fa8a72d@gmail.com> References: <8734xdni6y.fsf@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="568"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Denis Zubarev , 67061@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 11 07:55:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rCaCT-000AVh-TE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Dec 2023 07:55:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCaCD-0002q6-6Y; Mon, 11 Dec 2023 01:55:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCaBj-0002Ve-Nj for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 01:55:13 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCaBj-0000UL-Ek for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 01:54:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCaBx-0005Ue-O6 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 01:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Dec 2023 06:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67061 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67061-submit@debbugs.gnu.org id=B67061.170227766521054 (code B ref 67061); Mon, 11 Dec 2023 06:55:01 +0000 Original-Received: (at 67061) by debbugs.gnu.org; 11 Dec 2023 06:54:25 +0000 Original-Received: from localhost ([127.0.0.1]:52302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCaBN-0005TW-9F for submit@debbugs.gnu.org; Mon, 11 Dec 2023 01:54:25 -0500 Original-Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:50460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCaBI-0005T4-Ni for 67061@debbugs.gnu.org; Mon, 11 Dec 2023 01:54:23 -0500 Original-Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2886576cf18so2485434a91.1 for <67061@debbugs.gnu.org>; Sun, 10 Dec 2023 22:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702277640; x=1702882440; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CzEFglg/M/RP2EEj78vMoQP/bmy2N/7V5P8L9VgF7jc=; b=e5QtTj7ulV83G8dh2FMQdV0ZKCFF3p94OU+UCxKdRGQOgiX6Kn5XhX7mbbymQ7Cfy1 R4ZcEyM1eZ+euBfGZ/6v5EjwW3MUWlKSoTmR0toehy33ufzL3tIb50MNW77edMSaU6Zd 8uoqfQ4zvlw4egeXMTRQGcNQ9RRtzEu9gX0bG9viJYNQ/1ygvP3ot20egcdJ0Tq8Cf4C m8kjF2A7rOzt3IMWoaEGFN8H42NA/Agv7wDPMKm5NdN2UPBmN5vWvUi7ISxNlAhA+eRu 9S8u6HXDqLZnMva8jeXMV5yfqmyQEqVc45+oz2BgXC2NO4IzHTgGtYRVH+/iKj3s+oSq Cp1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702277640; x=1702882440; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CzEFglg/M/RP2EEj78vMoQP/bmy2N/7V5P8L9VgF7jc=; b=EtfV6POnD+PmEyHpwlngYbmTNEt1HjNQa8zOFFSSbI4jB/8ZZhlVIQErHZyCIQSfL5 cAHhG/4n8oX0Ao9GMvNQ0UlMdAcHoN9V0WQpGDeS/tVF0jb7LMaUfXp20Uj6OB8CNLxG tu1+SwEWFgKotkToujDRZgDOYIs1MH0CxkIVFQVP/XMsLan0aHNMvvQtbVBvjSUcAvzV KDpORnvE0F02aJja2GIFT0QfHfRRXty6/OGtUAZyqpkrxxzW00yvKhtJB1Et4pBoE4W1 bAc5R4oo3iK392NL6qShYdJgTgv3LWGhm+a4UUEQwKhHCAMDYn0mA7EOKh/uIb5vJqtq fT4g== X-Gm-Message-State: AOJu0Yz5+ptqilxmkAsNyZGXsPptqlsNOJeFq+TOUqBmCXTmKbPzIbx3 Nnr8PyTXjSSroJEsZuJwfr8= X-Google-Smtp-Source: AGHT+IHaJBDgadO/WupkhFvMw4k76MIt8V1LLKu3d3CcTTX/XDlnE2Gni0E/0rOimFtd5qsBWgPuCw== X-Received: by 2002:a17:90b:4012:b0:286:6cc1:286 with SMTP id ie18-20020a17090b401200b002866cc10286mr1267025pjb.81.1702277639950; Sun, 10 Dec 2023 22:53:59 -0800 (PST) Original-Received: from [192.168.1.7] (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id pm17-20020a17090b3c5100b002866c96fc71sm6245787pjb.38.2023.12.10.22.53.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Dec 2023 22:53:59 -0800 (PST) Content-Language: en-US In-Reply-To: <8734xdni6y.fsf@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275965 Archived-At: Here's my long due review: > Improve syntax highlighting for python-ts-mode. > > - Fontify compound keywords "not in" and "is not" (fixes bug#67015) This is great, though you'll need to rebase your changes on top of latest emacs-29 now, because I added one of the keywords when fixing bug#67015. Sorry for the trouble. > - Fix fontification of strings inside of f-strings interpolation, > e.g. for f"beg {'nested'}" - 'nested' was not fontified as string. I see that you removed string-interpolation feature, I don't know how I feel about it. For one, if this fix is to be applied to emacs-29, we cannot remove that feature—that's a breaking change IMO. Can we do this instead: in python--treesit-fontify-string, we check if string-interpolation feature is enabled, if it is, fontify string_start, string_content and string_end only; if not, fontify the whole string. > - Do not override the face of builtin functions (all, bytes etc.) with > the function call face > - Fontify built-ins (dict,list,etc.) as types when they are used in type hints LGTM > - Add missing assignment expressions Do you have examples on the type of assignments you are adding fontification for? Some general tips: for comments, we always write complete sentences, capitalize the first character and ends with a period. Also I see double empty lines and missing empty lines at places. Yuan