From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum Date: Sat, 22 Jun 2024 16:17:16 -0700 Message-ID: References: <36fGsZdSJ-V_6XVD6SuMoXHJKJ3e5x6xytnwwi2VJ0zzfcRRgOnY2FnWmCLfz4hifa1fkoMw0xCv4glCe8MZkoMqsUxsaY2N8LA1avOeaQk=@rjt.dev> <32ead709-88d3-4a96-b224-bc29aee3ae86@gutov.dev> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) 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="22686"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , 69625@debbugs.gnu.org, Randy Taylor To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 23 01:19:29 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 1sLA12-0005hc-Dg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jun 2024 01:19:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLA0f-0003XV-55; Sat, 22 Jun 2024 19:19:05 -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 1sLA0d-0003X1-8K for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 19:19:03 -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 1sLA0d-0008Na-0B for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 19:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLA0c-0008O2-0x for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 19:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jun 2024 23:19: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.171909831732192 (code B ref 69625); Sat, 22 Jun 2024 23:19:01 +0000 Original-Received: (at 69625) by debbugs.gnu.org; 22 Jun 2024 23:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:35596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLA0C-0008NA-Ir for submit@debbugs.gnu.org; Sat, 22 Jun 2024 19:18:36 -0400 Original-Received: from mail-pg1-f180.google.com ([209.85.215.180]:53534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLA0A-0008Mr-7X for 69625@debbugs.gnu.org; Sat, 22 Jun 2024 19:18:35 -0400 Original-Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7182a634815so978769a12.3 for <69625@debbugs.gnu.org>; Sat, 22 Jun 2024 16:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719098248; x=1719703048; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aJP/UeTGgc6JiEjrvHcQWjTk723KsxwLRSX9hUImOH8=; b=ROaKbOChIyDpb6hZ8KwwlF9bIPijdp+vXN/XjtaHCH6Eimk5xln69o0N9rQKxEWVI2 KnwzPzAn8fNSaCc5WE3u3glZJW0X8Wg2hOwQy3nU0qbh4C4nMNt8utCgJbv54PE2Vbxr ofOZplL5WkZ2DH7Rvgy73yVZyQd43r7fNwyicwqi0/NG7IYgY6nOlR7ZW1JAmGIsuR+b R8G2amM+t10/i2g3kGwNjJiO7xQ+2ohctOsSA2Z5T5Bf/CJPnfh1zD0xWjO/1XWRTmn1 JVMu9IfJhlpZb8Hq6C7wZznNGTvsIymqVmltCTui6sTb7RcST/e/mhfkV4tWzoSxOr+W hvAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719098248; x=1719703048; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aJP/UeTGgc6JiEjrvHcQWjTk723KsxwLRSX9hUImOH8=; b=P1iMWpIgGRs72NfhYZ7IU7/jYS62R+Ub1AZxJAt4XrVEoSTsbPM2a0AGmRoUjwCq8n lY8LVqO5cLC6SqKyvcR6WG0GsTBCM8KZsS0Qw0syllZyyEW8vDFGHC+U2mZSl9pWcRnh AepF7olHxoeKuYPRHGqx5ubKWvHVboAKHcIoT/jXddkV4LgOiUswrK7X1+n6KHgyyHah 9U9EWo5PLH4m074LF6bAtbQVcwRlTjWnF7KGPGnp4OGnUXgQEy2Tk/GkNXXOCfsInJNa ag9/hmX5YfB3/u/GCC/EBmTO0jWWNwPrWhfjY3/f+C1H4Fv9W+SpgFVPKug7tSD9nucW j64w== X-Forwarded-Encrypted: i=1; AJvYcCXSbY8HBeICTrWANF9e0bISzPTcVMbXQ0Cfq0EhfS95005tZvJfwHAtOs9/Oqrpa4vlRo++jzUBnr5VaB+r+LQIZKZXXn4= X-Gm-Message-State: AOJu0Yy6XEvVSwu+0tILk0JQeh/SXAlbe05RCApXF2qZaPkW1kjnhl8Q 5pcSGDzvApDq2sxH5UPTy0oYFQmWx3s1yWv7fgmYvv5NWgtR1NL9 X-Google-Smtp-Source: AGHT+IHbBdToY5ntJ5WSiUmbXEZKGh1Vbzza9fJtW840Ur7Fx3ewsMhWaAtxK5158Zwk7eyyNmODvA== X-Received: by 2002:a17:903:32ce:b0:1f9:b9ed:e84e with SMTP id d9443c01a7336-1fa23f1f37dmr12263535ad.58.1719098248106; Sat, 22 Jun 2024 16:17:28 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:20fa:247c:4f0e:e2a2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5ea7sm36021795ad.175.2024.06.22.16.17.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jun 2024 16:17:27 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3774.600.62) 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:287744 Archived-At: > On Jun 22, 2024, at 4:07=E2=80=AFAM, Stefan Kangas = wrote: >=20 > Yuan Fu writes: >=20 >>> On Mar 14, 2024, at 6:52 PM, Dmitry Gutov wrote: >>>=20 >>> 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? >>>=20 >>> Probably. >>>=20 >>>> I'm not sure how worth it would be to do something about that = though, or how >>>> easy. >>>=20 >>> Same. I haven't looked into it. >>>=20 >>>> 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. >>>=20 >>> 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. >>>=20 >>> If the style is consistent enough across the ecosystem, of course. >>>=20 >>> 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. >>=20 >> For some reason I couldn=E2=80=99t see Randy=E2=80=99s messages. So = sorry if I missed anything. I suggest we go ahead with guessing and add = the variable if enough people complain. Personally speaking I believe = the vast majority of Rust community wouldn=E2=80=99t write Rust code = with capitalized variable and non-capitalized types. The Rust community = is very much inclined to the standard style, AFAICT. >=20 > Yuan, did you make any progress here? =46rom what I can tell Randy isn=E2=80=99t very convince of this idea, = so I didn=E2=80=99t make any changes. Randy, should we keep the status = quo and close this or should we explore something else? Yuan=