From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#41684: [PATCH] Highlight typed variables in python Date: Sat, 13 Jun 2020 23:40:27 +0300 Message-ID: References: <20200603115103.69611-1-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="9658"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.36.3 Cc: 41684@debbugs.gnu.org To: Andrii Kolomoiets Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 22:41:10 2020 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 1jkCxi-0002QY-Fa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 22:41:10 +0200 Original-Received: from localhost ([::1]:53110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkCxh-0007N1-Ec for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 16:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkCxa-0007Mt-JH for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 16:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59251) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkCxa-0000Tk-7p for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 16:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jkCxa-0003Il-4f for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 16:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jun 2020 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41684 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41684-submit@debbugs.gnu.org id=B41684.159208083812650 (code B ref 41684); Sat, 13 Jun 2020 20:41:02 +0000 Original-Received: (at 41684) by debbugs.gnu.org; 13 Jun 2020 20:40:38 +0000 Original-Received: from localhost ([127.0.0.1]:42564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkCxC-0003Hy-Jw for submit@debbugs.gnu.org; Sat, 13 Jun 2020 16:40:38 -0400 Original-Received: from forward105o.mail.yandex.net ([37.140.190.183]:54448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkCx9-0003Hf-OO for 41684@debbugs.gnu.org; Sat, 13 Jun 2020 16:40:36 -0400 Original-Received: from forward103q.mail.yandex.net (forward103q.mail.yandex.net [IPv6:2a02:6b8:c0e:50:0:640:b21c:d009]) by forward105o.mail.yandex.net (Yandex) with ESMTP id CAC4C4200970; Sat, 13 Jun 2020 23:40:28 +0300 (MSK) Original-Received: from mxback1q.mail.yandex.net (mxback1q.mail.yandex.net [IPv6:2a02:6b8:c0e:39:0:640:25b3:aea5]) by forward103q.mail.yandex.net (Yandex) with ESMTP id C639F61E0002; Sat, 13 Jun 2020 23:40:28 +0300 (MSK) Original-Received: from vla3-4c649d03f525.qloud-c.yandex.net (vla3-4c649d03f525.qloud-c.yandex.net [2a02:6b8:c15:2584:0:640:4c64:9d03]) by mxback1q.mail.yandex.net (mxback/Yandex) with ESMTP id pSAtVxq7TU-eSqOVnZU; Sat, 13 Jun 2020 23:40:28 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592080828; bh=cAPrczEUQjgHmNRi3Uz3qxUJSg8z/pvonz1L9Elv4Ww=; h=In-Reply-To:Cc:To:From:Subject:References:Date:Message-ID; b=YuHcZF8eso/X0s3QN/CtaMIZF1dKgmYwKnjS4TpeSZ3aAxLYsJmWtdhRgjXJWAlKh qy8FE4l6aRtwkcHqiiZ3R6LnWCxnxa4cPfJtdKK3U7Ge31OQka/sa2zISVid2sdODt D7Jwvr5bzmlTs2i41eUrERANr9eO64yxzThfcz48= Authentication-Results: mxback1q.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by vla3-4c649d03f525.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id p3orpb8RYH-eRXCallQ; Sat, 13 Jun 2020 23:40:27 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:181932 Archived-At: On Sat, 2020-06-13 at 23:01 +0300, Andrii Kolomoiets wrote: > Hi Konstantin, > > > * progmodes/python.el (python-font-lock-keywords-maximum-decoration): > > recognize typed variables like "foo: int = 1" as well. > > Good work! > > Any plans to recognize typed variables like "foo: List[int] = [1]" as > well? ;-) Thank you for the follow up! This is a good example to improve upon, I haven't thought about it. I don't currently have plans, so if you wanted that, sure go for it :) I'm mostly sending improvements as I work with Python at may dayjob, I wasn't stumbling upon such construction there, so I'm not too worried just yet. FTR: if anybody is interested why this font-lock-variable-face matters, the color-identifiers-mode uses it to highlight identifiers in code with different colors. Immensely helps in reading the code.