From unknown Sat Aug 16 10:47:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78838 <78838@debbugs.gnu.org> To: bug#78838 <78838@debbugs.gnu.org> Subject: Status: [PATCH] 31.0.50; python-ts-mode fontifies constructors as functions, not types Reply-To: bug#78838 <78838@debbugs.gnu.org> Date: Sat, 16 Aug 2025 17:47:56 +0000 retitle 78838 [PATCH] 31.0.50; python-ts-mode fontifies constructors as fun= ctions, not types reassign 78838 emacs submitter 78838 Jostein Kj=C3=B8nigsen severity 78838 normal tag 78838 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 19 09:48:35 2025 Received: (at submit) by debbugs.gnu.org; 19 Jun 2025 13:48:35 +0000 Received: from localhost ([127.0.0.1]:33689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uSFd4-0007g8-BW for submit@debbugs.gnu.org; Thu, 19 Jun 2025 09:48:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:40752) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uSFd1-0007ey-LA for submit@debbugs.gnu.org; Thu, 19 Jun 2025 09:48:32 -0400 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 1uSFcl-0002jZ-Lw for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2025 09:48:16 -0400 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uSFch-0002wm-Nb for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2025 09:48:14 -0400 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id F21AC1140137; Thu, 19 Jun 2025 09:48:03 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Thu, 19 Jun 2025 09:48:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1750340883; x=1750427283; bh=W3 mI8UDpeD1wQ0XF4rAJYhJ92m5eXedJnlWi0NAPnIA=; b=P776FPXG7c6y5slrf3 EoIeQAY/HFt99XsLnj/zvxUpLXYsjio5qWb4wOMpsHSLyi4fSwsXzdJPgwEujeck wtQse+8okhLNmLd+8AAITDTZKrG05BxybPHS2T5+TczTRAWxj1YSmbailDN8B7d1 LOPoW27N13qPXtbt30SOfOTXbqaHB8TRHNGchyx+salEqqQKDJ4B5R8nWkaF9m6b AdcRJo6u4i7zXvuq4aAmJPL+V1h+cT+F8ZlEVjzVhLKe/oPo+655oKCnJFM2IkVm N4H/gCSuvvd4zZ1ON/1mcpfxHGjfLYt6pWmFDZMzOrCjmRpf/7DfZMdnuzzm4+47 aOgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1750340883; x= 1750427283; bh=W3mI8UDpeD1wQ0XF4rAJYhJ92m5eXedJnlWi0NAPnIA=; b=p rd/W+XOjCGf+GJXtBFQM8Y3omCVdVUM3w9VCNSQ7NWh42CsNCBQ53PZsTQY78fvV 0ARfR2LLX6g+ph/w2wMPcs9nQEyDh0G7U6DyWOpXaWHTHAlbzuvnx78ZcZEA0B39 WwAP0gdxtW30i4yEDDlRL3jp6EzUcuQgvZCB1mUIbS6Bff7Mia8LwNOyUYcYG7U4 N+NJoswJGE/KRbOApb7XPjPyLYEfVDLpd1LbwoeByutr5EtSIQ62LbaA6HLBLvPe k8SWtSvcQcf6XuFwv74I99dMDVN2TK/bxKb8mgtT6lw66cAUv6Ae1QJPGXdkqYud yJiXs8HEdRIishuXc9B/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdehieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefhtggguffkffevvffosegrtdhmrehhtddvne cuhfhrohhmpeflohhsthgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgv tghurhgvrdhkjhhonhhighhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeelteevue ffiefhvdegiedvieevleelgeetudejhfejkeekffeukeejgfffgefgleenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvg gtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvthdpnhgspghrtghpthhtohepvddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdroh hrghdprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Jun 2025 09:48:02 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Content-Type: multipart/alternative; boundary="Apple-Mail=_AA84D8B5-99C8-433E-A915-E4F6195480FB" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: [PATCH] 31.0.50; python-ts-mode fontifies constructors as functions, not types Message-Id: Date: Thu, 19 Jun 2025 15:47:50 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3826.600.51.1.1) Received-SPF: pass client-ip=202.12.124.149; envelope-from=jostein@secure.kjonigsen.net; helo=fout-b6-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit Cc: Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --Apple-Mail=_AA84D8B5-99C8-433E-A915-E4F6195480FB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey everyone. When using python-ts-mode to write or read code, I've noticed it has a = few inconsistencies: 1. type-constructors are fontified as regular functions, not the type = they represent. 2. typed default parameters are not fontified as variables 3. kwarg arguments are not fontified either Attached is a patch which fixes this :) =EF=BF=BC =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen --Apple-Mail=_AA84D8B5-99C8-433E-A915-E4F6195480FB Content-Type: multipart/mixed; boundary="Apple-Mail=_D7D52892-8417-4FB8-86FF-62C8D4FBBD81" --Apple-Mail=_D7D52892-8417-4FB8-86FF-62C8D4FBBD81 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
Hey everyone.

When using python-ts-mode to write or read code, I've noticed it has a few inconsistencies:

1. type-constructors are fontified as regular functions, not the type they represent.
2. typed default parameters are not fontified as variables
3. kwarg arguments are not fontified either

Attached is a patch which fixes this :)

--Apple-Mail=_D7D52892-8417-4FB8-86FF-62C8D4FBBD81 Content-Disposition: attachment; filename=0002-python-ts-mode-Improve-fontification.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0002-python-ts-mode-Improve-fontification.patch" Content-Transfer-Encoding: quoted-printable =46rom=20126396350281591ac6432f6cc0a6bb0a7b3d9ccd=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Thu,=2020=20Mar=202025=2010:39:31=20= +0100=0ASubject:=20[PATCH=202/4]=20python-ts-mode:=20Improve=20= fontification=0A=0Apython--treesit-settings:=20Fontification=20based=20= on=20selectors=20&=20code-conventions=0A=0A-=20Constructor:=20Fontified=20= as=20type,=20not=20function-call.=0A-=20Typed=20default=20parameters=0A-=20= Fontify=20kwargs=20in=20function=20calls=20as=20property-use.=20= Differentiate=20from=0A=20=20variable-use=20(passed=20in=20arguments)=0A= ---=0A=20lisp/progmodes/python.el=20|=207=20++++++-=0A=201=20file=20= changed,=206=20insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/python.el=20b/lisp/progmodes/python.el=0Aindex=20= 3b83c5d3319..151d12d8557=20100644=0A---=20a/lisp/progmodes/python.el=0A= +++=20b/lisp/progmodes/python.el=0A@@=20-1236,6=20+1236,7=20@@=20= python--treesit-settings=0A=20=20=20=20=20=20(parameters=20(identifier)=20= @font-lock-variable-name-face)=0A=20=20=20=20=20=20(parameters=20= (typed_parameter=20(identifier)=20@font-lock-variable-name-face))=0A=20=20= =20=20=20=20(parameters=20(default_parameter=20name:=20(identifier)=20= @font-lock-variable-name-face))=0A+=20=20=20=20=20(parameters=20= (typed_default_parameter=20name:=20(identifier)=20= @font-lock-variable-name-face))=0A=20=20=20=20=20=20(lambda_parameters=20= (identifier)=20@font-lock-variable-name-face)=0A=20=20=20=20=20=20= (for_in_clause=0A=20=20=20=20=20=20=20left:=20(identifier)=20= @font-lock-variable-name-face)=0A@@=20-1266,7=20+1267,11=20@@=20= python--treesit-settings=0A=20=0A=20=20=20=20:feature=20'function=0A=20=20= =20=20:language=20'python=0A-=20=20=20'((call=20function:=20(identifier)=20= @font-lock-function-call-face)=0A+=20=20=20'(((call=20function:=20= (identifier)=20@font-lock-type-face)=0A+=20=20=20=20=20=20(:match=20= "\\`[A-Z][A-Za-z0-9]+\\'"=20@font-lock-type-face))=0A+=20=20=20=20=20= (call=20function:=20(identifier)=20@font-lock-function-call-face)=0A+=20=20= =20=20=20(call=20arguments:=20(argument_list=20(keyword_argument=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20name:=20(identifier)=20= @font-lock-property-name-face)))=0A=20=20=20=20=20=20(call=20function:=20= (attribute=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20attribute:=20(identifier)=20@font-lock-function-call-face)))=0A=20= =0A--=20=0A2.50.0=0A=0A= --Apple-Mail=_D7D52892-8417-4FB8-86FF-62C8D4FBBD81 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen

= --Apple-Mail=_D7D52892-8417-4FB8-86FF-62C8D4FBBD81-- --Apple-Mail=_AA84D8B5-99C8-433E-A915-E4F6195480FB-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 21 04:19:05 2025 Received: (at 78838-done) by debbugs.gnu.org; 21 Jun 2025 08:19:05 +0000 Received: from localhost ([127.0.0.1]:33549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uStRI-00039g-3M for submit@debbugs.gnu.org; Sat, 21 Jun 2025 04:19:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42448) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uStRE-00037z-P2 for 78838-done@debbugs.gnu.org; Sat, 21 Jun 2025 04:19:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uStR8-0000Nk-3I; Sat, 21 Jun 2025 04:18:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GpSn2P0Ju3GWvm4Prnusf+6U+QXUw9rB5RO/l6xYEj8=; b=KM+zmn+w7bch9F2mZ4Y3 Tn3in6Zdb5wF03PHKsP/Wr/gF7ve1wFqp8lyeyZ4lps2XUjcxWfDiI7lpcGWkqcoArSr6wMavN5aF vQinNyrpfC4t7brtmeG05oGInCPf1sT6oif0oXtOKvKLmLQLfMpMBqcIWlQjgU7P+Q7BFtxYExg3p 1tZYzy/lZarNgUBNpeWaHmJqnZ9xs+6GbR7gKP4ZIsCQOEmDefT9C59QvXjZnXBifwQxLKDHMXHkT +xsSoPC/IlcxkX140bkwv/T89hYeVjJCqTLq+h4angrPrroC9efuTIXmqv/r1dOK80Il1/vniap5A M0gRB0xDE8ezJw==; Date: Sat, 21 Jun 2025 11:18:51 +0300 Message-Id: <86cyaxjyms.fsf@gnu.org> From: Eli Zaretskii To: Jostein =?utf-8?Q?Kj=C3=B8nigsen?= In-Reply-To: (message from Jostein =?utf-8?Q?Kj=C3=B8nigsen?= on Thu, 19 Jun 2025 15:47:50 +0200) Subject: Re: bug#78838: [PATCH] 31.0.50; python-ts-mode fontifies constructors as functions, not types References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78838-done Cc: casouri@gmail.com, 78838-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Yuan Fu > From: Jostein Kjønigsen > Date: Thu, 19 Jun 2025 15:47:50 +0200 > > When using python-ts-mode to write or read code, I've noticed it has a few inconsistencies: > > 1. type-constructors are fontified as regular functions, not the type they represent. > 2. typed default parameters are not fontified as variables > 3. kwarg arguments are not fontified either > > Attached is a patch which fixes this :) Thanks, installed on the master branch, and closing the bug. From unknown Sat Aug 16 10:47:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Jul 2025 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator