From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum Date: Sat, 9 Mar 2024 00:56:04 +0200 Message-ID: <085f5fb8-ac4c-45de-80e8-8f60adf54515@gutov.dev> References: 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="23507"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Yuan Fu , 69625@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 08 23:56:52 2024 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 1rij91-0005sO-9P for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Mar 2024 23:56:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rij8h-0005EM-Dd; Fri, 08 Mar 2024 17:56:31 -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 1rij8f-0005EE-NE for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 17:56:29 -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 1rij8f-0006Ul-Ek for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 17:56:29 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rij9B-0004cC-MD for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 17:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2024 22:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69625 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69625-submit@debbugs.gnu.org id=B69625.170993861317728 (code B ref 69625); Fri, 08 Mar 2024 22:57:01 +0000 Original-Received: (at 69625) by debbugs.gnu.org; 8 Mar 2024 22:56:53 +0000 Original-Received: from localhost ([127.0.0.1]:59909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rij92-0004br-M5 for submit@debbugs.gnu.org; Fri, 08 Mar 2024 17:56:53 -0500 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:50269) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rij8x-0004bZ-3G for 69625@debbugs.gnu.org; Fri, 08 Mar 2024 17:56:51 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3230832002E2; Fri, 8 Mar 2024 17:56:07 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 08 Mar 2024 17:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1709938566; x=1710024966; bh=L5HwASJ2oH7A6ovSYOjIkCsv4Rm0sXPmsiOnMfKWjAs=; b= RbGJutg6sWWcY80cJj8BLYp54Pw5117xAVYKf710XPyKb9h379ed+uxjU3RRFJ5p IVWLTbvC5JPyPWL/o5UsrvpvODVUAsx9C5xfqm3lpso7cdlIT0K8LtrHZJjxZRER 4qnXU7iOQR2h1KZdN3P9xWCx9xD7zOhokeJLYqXmRMh1dpZoaI/u7yv+6vG3LBmq p3y5XoBOgyXChAh5MR8PGjz5PGsDRTIrDBZrXe6LeLtKrQSwNsyeRUbWkked0sG7 jLqH3bUymFE63JCRpSLaqsVKx47O14jnnCDo1kH0cqY7mrNta03KtR7S9U+g0lPC Fn18ppm6Z/2Fa03Jjx9X3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709938566; x= 1710024966; bh=L5HwASJ2oH7A6ovSYOjIkCsv4Rm0sXPmsiOnMfKWjAs=; b=h 1CToDRghMj3XmUoFhFx/kS552hi2VkJfQQizgqo8tUMP0Rixq1OYWwzglWf0Jqbb W0mID8M7pW+KRv9Cshj3gUSFXUtOPiHrMHlAhZOAmxCWPnwAuAuS2CP2LhKucOD3 FuvkSqPHoqVpY05mDrmFbrZMLfdhNuWKYbSwXD7vcgf/90Jgc2h6lsKPTjUHQz82 yexxBUZChYWATMeoozMbCfz2LOwaL4JMBqF9pZzPZ57U5idTYYjSj7EdXbT9JSs5 SUmYlbhPgEXMbnoheSq8JVIUW4opvNLUx+zVJ3KbvOFD64uMTMJlUchL9CRsK01C ale5P2ontpT4N12AB9IcA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieeigddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre dttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhht ohhvrdguvghvqeenucggtffrrghtthgvrhhnpeegueegteffuddvjeevvdelleeitdeftd duhfeffeffjedukeevjedvfeffgfevgeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Mar 2024 17:56:05 -0500 (EST) Content-Language: en-US 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281277 Archived-At: On 08/03/2024 06:43, Yuan Fu wrote: > The problem is follows: given the rust code below, some enum are not > fontified with type face under font lock level 3, and those enum are > fontified as function or variable under font lock level 4. > > fn main() { > func(MyEnum::VariantA(0)); > func(MyEnum::VariantB); > func(VariantC); > func(VariantD(0)); > } > > VariantA and VariantB are fontified correctly, but VariantC and VariantD > are not. > > I think a simple rule that fontifies every capitalized identifier would > fix this. But I don’t know if that’ll create other problem. AFAIK > capitalized identifier is always some type in rust, right? This might be more of an issue with highlighters order. As you can see, level 3 fontifies these as 'type' already, and does that because the identifiers are capitalized. Some level 4 rules probably either come earlier than where they should be (thus applying before the ones with the "capitalized" matcher), or they should use a "not capitalized" matcher if moving them down would cause other problems.