From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61303: 29.0.60; rust-ts-mode does not consistently fontify nested macro-invocations Date: Sun, 05 Feb 2023 23:22:18 +0100 Message-ID: <871qn37nxh.fsf@thornhill.no> References: Reply-To: Theodor Thornhill 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="20293"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dev@rjt.dev, jostein@kjonigsen.net, 61303@debbugs.gnu.org To: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 05 23:23:14 2023 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 1pOnPl-00053k-PM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Feb 2023 23:23:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOnPd-0006qZ-1Q; Sun, 05 Feb 2023 17:23:05 -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 1pOnPa-0006qM-Ub for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 17:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOnPa-0005Zz-Co for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 17:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOnPa-0001tQ-80 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 17:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 22:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61303 X-GNU-PR-Package: emacs Original-Received: via spool by 61303-submit@debbugs.gnu.org id=B61303.16756357437208 (code B ref 61303); Sun, 05 Feb 2023 22:23:02 +0000 Original-Received: (at 61303) by debbugs.gnu.org; 5 Feb 2023 22:22:23 +0000 Original-Received: from localhost ([127.0.0.1]:46645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOnOw-0001sC-Kb for submit@debbugs.gnu.org; Sun, 05 Feb 2023 17:22:22 -0500 Original-Received: from out-250.mta0.migadu.com ([91.218.175.250]:29681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOnOv-0001s2-28 for 61303@debbugs.gnu.org; Sun, 05 Feb 2023 17:22:21 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1675635739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n1YXUWZdTxhwnrFBlwD4S6dOMpuCRV1PLSf5rLlQIYU=; b=cvOD1dDNjGoqJGPtlsGnjeHWqap712+qM5S2/4qF9Ra6WQU0AQ6SQVUmaW2KGsqsKpQldL 9gDjP0WQdQKfrCMR0QqEL9olcc4ugUaysWDN6SXhvGmbdWiNXBoaX+IdN1L/U8iw4SdAJr d+db7vgdwoMaJ2+jzhA0fUfdyldRyiksF1EDCqWejNHFLRLkO+cL9AX5f/pDcPjpVJKrVG chEPcYTPxE0XiALBPlNLSdbssN4pY5irKOcm49ghv+I2yKd0DkUUfnSaeOBAwhq0xeAHyS IwHNkMgL0OIRxbKJN/Kd0PAHHyVxqVPtx1PHzKxR9hXTrzsM/iXAbUpRPXkCQA== In-Reply-To: ("Jostein =?UTF-8?Q?Kj=C3=B8nigsen?="'s message of "Sun, 5 Feb 2023 22:08:32 +0100") X-Migadu-Flow: FLOW_OUT 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:254902 Archived-At: Jostein Kj=C3=B8nigsen writes: > Hey there. > Hi! > Thanks for another tree-sitter based mode to hack at :D > > I think I've found an error/lacking in rust-ts-mode where we may have to = move > upstream to fix it. > > Consider the following contrived (and yes, not very idiomatic) rust-code: > > let result =3D format!("{}{}", > =C2=A0=C2=A0=C2=A0 "Well yes", > =C2=A0=C2=A0=C2=A0 format!("Or {} no?", "possibly")); > > With rust-ts-mode first format! invocation will get highlighted as a > macro-invocation, while the second will not. > > Inspecting this using treesit-explore-mode, I get the following tree: > > (let_declaration let pattern: (identifier) =3D > =C2=A0 value: > =C2=A0=C2=A0 (macro_invocation macro: (identifier) ! > =C2=A0=C2=A0=C2=A0 (token_tree ( > =C2=A0=C2=A0=C2=A0=C2=A0 (string_literal " ") > =C2=A0=C2=A0=C2=A0=C2=A0 (string_literal " ") > =C2=A0=C2=A0=C2=A0=C2=A0 (identifier) > =C2=A0=C2=A0=C2=A0=C2=A0 (token_tree ( > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string_literal " ") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string_literal " ") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )) > =C2=A0=C2=A0=C2=A0=C2=A0 ))) > =C2=A0 ;) > > Notice the lack of a second/nested "macro_invocation"-node. Instead the s= econd > macro is just denoted as a "identifier". > > To fix this, we'll probably need to upstream some bug-reports and PRs? Sounds like it! Just in case - the code compiles, right? Theo