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: Fri, 15 Mar 2024 03:52:38 +0200 Message-ID: <32ead709-88d3-4a96-b224-bc29aee3ae86@gutov.dev> References: <36fGsZdSJ-V_6XVD6SuMoXHJKJ3e5x6xytnwwi2VJ0zzfcRRgOnY2FnWmCLfz4hifa1fkoMw0xCv4glCe8MZkoMqsUxsaY2N8LA1avOeaQk=@rjt.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24902"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69625@debbugs.gnu.org To: Randy Taylor , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 15 02:53: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 1rkwla-0006E3-Me for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Mar 2024 02:53:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkwlF-0000LA-NY; Thu, 14 Mar 2024 21:53:29 -0400 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 1rkwlE-0000L0-2n for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2024 21:53:28 -0400 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 1rkwlC-0006iV-3s for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2024 21:53:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rkwll-0004MS-NN for bug-gnu-emacs@gnu.org; Thu, 14 Mar 2024 21:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Mar 2024 01:54: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.171046761016726 (code B ref 69625); Fri, 15 Mar 2024 01:54:01 +0000 Original-Received: (at 69625) by debbugs.gnu.org; 15 Mar 2024 01:53:30 +0000 Original-Received: from localhost ([127.0.0.1]:50999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkwlF-0004Lg-Ed for submit@debbugs.gnu.org; Thu, 14 Mar 2024 21:53:30 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:55967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkwlA-0004LQ-27 for 69625@debbugs.gnu.org; Thu, 14 Mar 2024 21:53:27 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 32EC53200063; Thu, 14 Mar 2024 21:52:42 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 14 Mar 2024 21:52:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :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=1710467561; x=1710553961; bh=wdJKPRQV+8TaiVsafUEWEttjLuLNnNjI6Chzlmxj3tM=; b= gAujNZx11x5qWYx0dTZwWt1LGBeyn5cNEI7gtV89KwulpjDHSKNUZgRBm7QyfgKm y/CPHF/45Y0COsZLG8zenNxrO3ToYZypyvWx00vvEd8CU6/JPiEtk2iufA0YH0Wi bptbQNiNeI51/T3QTr6SN2NoHQgqBmLpbqo5E/LyoLNtIniYiQjkGL/JZTtPTq13 ByxHUHSeZXjl/ZrD9vKNdtPNvipEVXmSh4THbh5BCbxpojsGNZdHw+xlK68gm7YA btliIQxvIHdPvfCSMD0cKMtikf32ktNtHw2dTs2BUWgcMAiVajwLG+gd+SAQ49mk qqpBgU5Sf6rXl306TWMz5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1710467561; x= 1710553961; bh=wdJKPRQV+8TaiVsafUEWEttjLuLNnNjI6Chzlmxj3tM=; b=B mnj/L/KhuZ2VJf3gm5QB8dQpPTVdOTtJtXiQacBmx08S/6DTCiLgm60fn1IrLFfg ig3aqCVV09vFdUbmKZZUGSrRJCmLvWiuOOmBEPqyFPAbSM3DNpDX9H11EEmV8XRG DqPMtca5yp1alp+RNJNh48WLqkCWfUE3o7nvR30vzIb/4+Ng7+KM2DTLCoiduoUZ VzSfPQE+MVbr+H6soEYM4lqKV9UexykeAsnytLh0Fjjv2WAI4goCurusCCkJUdQV 9cSAwVJepSIrDWWT4PnMu1ivXo+qGvhXfs/pG7Ny6I3eoIPK1ufUxKPNFMLVf0oY brWDEK22olWr0U8fjXqGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeekgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtje ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvd evieekueeftddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Mar 2024 21:52:40 -0400 (EDT) Content-Language: en-US In-Reply-To: <36fGsZdSJ-V_6XVD6SuMoXHJKJ3e5x6xytnwwi2VJ0zzfcRRgOnY2FnWmCLfz4hifa1fkoMw0xCv4glCe8MZkoMqsUxsaY2N8LA1avOeaQk=@rjt.dev> 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:281636 Archived-At: On 09/03/2024 05:50, Randy Taylor wrote: > VariantA gets highlighted as a type and not a function at level 3 because that > level doesn't support functions, but does support types. Maybe that could be > considered a bug in that it shouldn't be highlighted at all for level 3? Probably. > I'm not sure how worth it would be to do something about that though, or how > easy. Same. I haven't looked into it. > For VariantC, our (and tree-sitter's) best guess is that it's a variable. > We can't really know it's a type without guessing - like assuming a capitalized > identifier is a type, and I don't think that's something we can assume. People > can have capitalized functions and variables even if that goes against Rust's > usual style. Perhaps as a compromise we could introduce a variable (or something) > that lets the user specify that all capitalized identifiers should be treated as > types? Maybe it even makes sense to default it to that behaviour since I believe > most Rust code follows that style. We do have some rules already that are based off whether an identifier is capitalized. I.e. some for use_as_clause, and another for highlighting an identifier with font-lock-constant-face if it's ALL_CAPS. So it might be logical to carry on with that approach. If the style is consistent enough across the ecosystem, of course. We could add a variable too, but that'd make the rules more complex so it would be helpful to understand first whether there are users who would benefit.