From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#73877: 30; rust-ts-mode: highlight the possible type suffix of number literals Date: Tue, 22 Oct 2024 23:05:21 +0000 Message-ID: References: <874j587459.fsf@poincare.umons.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13167"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73877@debbugs.gnu.org, Stefan Kangas To: Christophe TROESTLER Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 23 01:06:58 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 1t3Nxp-0003H1-1i for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Oct 2024 01:06:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3NxV-0001hR-OE; Tue, 22 Oct 2024 19:06:37 -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 1t3NxT-0001gg-AF for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 19:06:36 -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 1t3NxT-0007Js-0b for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 19:06:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=l28UFsrkvCF7q2XVJVxk3sMdzVk56vl1oyp55xCRYlY=; b=Cs47Es8BQpeAlMxbm3iradp1lSFt6KoMSNrNaoWCyx+/8/hV2TTOSh9x5A9I+VJ6yNBtkUqx8JPt1iJuMvYImzO9tXs8JxDSCoh+saMmShEiSYYKeW7Dka33nlTTqnEfyg8OpOWvtBnwfZAT07mEr64X8JZlR3WTTIo37XZwtbM45CaXo7D9elCoY79EfoXcbrBU0Wg3dWXgYWkXFXyu/VMkjh+yfOj0cZPq/qmPmv3kF3JNduYc7I4E9ZxfCek8fQ6PFgwTcw6B/NzRhcyc4FfXOzimvZnLIPh1Tli+LzPF5lP4AGnuag6JX8UioVs+O/ENK+npSzhDu0HGLN6L0A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3Nxv-0005Q5-5S for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 19:07:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Oct 2024 23:07:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73877 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73877-submit@debbugs.gnu.org id=B73877.172963836220719 (code B ref 73877); Tue, 22 Oct 2024 23:07:03 +0000 Original-Received: (at 73877) by debbugs.gnu.org; 22 Oct 2024 23:06:02 +0000 Original-Received: from localhost ([127.0.0.1]:57795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3Nww-0005O7-AA for submit@debbugs.gnu.org; Tue, 22 Oct 2024 19:06:02 -0400 Original-Received: from mail-4022.proton.ch ([185.70.40.22]:62623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3Nwt-0005NZ-3X for 73877@debbugs.gnu.org; Tue, 22 Oct 2024 19:06:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail3; t=1729638323; x=1729897523; bh=l28UFsrkvCF7q2XVJVxk3sMdzVk56vl1oyp55xCRYlY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=N8GXk4USdEwBs/ZpIz+O30t5zO6k2hbpSDj5y6ZILFi/ybVZC5Tq1AtL8widfErSR w/Hz1LFI/HPvZVXbjRiKsa++jn7uN/Fty7PxGqT5MMjywwmoisMCT8ketaN2cJPLta fbg86vog09F/SnhcfDizi/hfnDhnP10cWWmhH9xvk5YgVwjr5erABI9p3q8XAFpH3+ ZtTZ/pb+pQCI4kgSwRSFyzfE3VHDgLTKs4G+n6n/sLVeYTQAO52oiXnUVT3w41F3FK iDTCGMnZnKYiyZfUWIx5resSuhmNAKJqAPEEGZlDgvHbkvPfeq9UL5P5+ODNmYXko2 0N2Qmu3mYCMnQ== In-Reply-To: Feedback-ID: 44397038:user:proton X-Pm-Message-ID: 8361a36b838ed841efaff5bc45d604afb8f5c838 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:294129 Archived-At: > Christophe TROESTLER Christophe.TROESTLER@umons.ac.be writes: >=20 > > Hi, > >=20 > > In order to make Rust number literals such as 1usize, 1.0_f64,... more = legible, the type suffix should be highlighted. The attached patch to rust-= ts-mode does that. > >=20 > > Best, > > Christophe Thanks for working on this Christophe. I think this will need to be gated behind a variable which should retain th= e existing behaviour by default. Would you also be able to add some tests for this? You can see how the font-lock tests are done in the test/lisp/progmodes/rus= t-ts-mode-tests.el file, and add some to the rust-ts-mode-resources/font-lock.rs file. We might need a new file for this one, actually, since we'd want to test bo= th cases. I have some comments below: + "Regexp that matches any suffix on number litterals as documented ^ literals +at https://doc.rust-lang.org/reference/tokens.html#suffixes") Add a period at the end. + "Fontify number literals, highlighting the optional type if present" Add a period at the end. We may also want to say something like: "highlighting the optional type bas= ed on the value of `name-of-the-variable'." once the variable to control it is added.