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#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties Date: Sat, 18 Feb 2023 20:42:56 +0000 Message-ID: References: <6209c097-0369-828a-7513-d8afb73fd7f0@secure.kjonigsen.net> <61cb2b34-0be2-1f69-e72d-5351fbe9e48f@yandex.ru> <5075852e-480b-7ca9-ba46-8de230ed8df5@secure.kjonigsen.net> <6b75a99f-05fd-cde9-e9fe-7191f12d72e1@yandex.ru> <8b3e632b-18de-f23c-675a-24905bbfbc23@yandex.ru> 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="13914"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= , Yuan Fu , 61302@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 21:44:17 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 1pTU47-0003SX-Ue for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 21:44:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTU3w-0003uW-Lp; Sat, 18 Feb 2023 15:44:04 -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 1pTU3u-0003uH-OG for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 15:44: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 1pTU3u-0000jw-FQ for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 15:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTU3u-0001ei-A6 for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 15:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 20:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61302 X-GNU-PR-Package: emacs Original-Received: via spool by 61302-submit@debbugs.gnu.org id=B61302.16767529986301 (code B ref 61302); Sat, 18 Feb 2023 20:44:02 +0000 Original-Received: (at 61302) by debbugs.gnu.org; 18 Feb 2023 20:43:18 +0000 Original-Received: from localhost ([127.0.0.1]:45042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTU3C-0001dZ-9G for submit@debbugs.gnu.org; Sat, 18 Feb 2023 15:43:18 -0500 Original-Received: from mail-4018.proton.ch ([185.70.40.18]:35799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTU3A-0001dH-0d for 61302@debbugs.gnu.org; Sat, 18 Feb 2023 15:43:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1676752989; x=1677012189; bh=/4/dQOzUEn8nt48aCIsmdlOqoICn5tMxr24Evw6lrYg=; 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=vV4OfQDmnMsuTxjCZvHRLu9IPa4Cy3ST/2TkjUvZMcmJt2teQvEr1Zn39g3paeoJk SIm3VET7l4Hl7dJ0+qSQECUUiTEl7pW+jfBNPn60iuTx5e4wUkFit23ppVkZVQaroH Mvp5Vy/crFSgVv2XPDvPGfSm5GX7/YwUTAayWkgU1jfPpeEYp+dwe3Ve9HLYUSFbsb QrPUWyhdAyLehL9+ndZVCzrX9IKghqHBFeM23WTN1PnTz0E/G2IulTJY9vu9LxksjK QKSih9weRdJvq1sApAndbZmw9XTEW9aGS0n3bnrnS/U2lgfovi34SclF6EhkGkD9v/ /qphAQujIZ8GA== In-Reply-To: Feedback-ID: 44397038:user:proton 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:255993 Archived-At: On Friday, February 17th, 2023 at 22:27, Dmitry Gutov wr= ote: >On 16/02/2023 03:53, Dmitry Gutov wrote: >> But the new one will need to check that the parent is >> 'scoped_identifier', and the grandparent is not a 'call_expression' >> node, or 'use_as_clause', or 'use_declaration', etc, and the name itself >> is lowercase -- when so, skip highlighting. And highlight with one of >> the two faces when otherwise. >> >> Shouldn't be too hard to do, but I'm wary about the additional cost at >> runtime. > >So, this seems to work. > >At the cost of some performance overhead due to :pred in the 'variable' >query (the rest of the changes don't seem to affect the runtime -- guess >the Lisp calls were balanced out by fewer queries). Thanks, I think this is actually a lot cleaner than the gazillion queries w= e had. It looks good barring a few issues I've noticed. use a::b::{self as ab, A as abc}; A should be highlighted as a type. If abc is Abc, Abc should be highlighted as a type. use std::Fs as Self_fs; Self_fs should be highlighted as a type. I only quickly tested, but re-adding these queries: ``` ((use_as_clause alias: (identifier) @font-lock-type-face) (:match "^[A-Z]" @font-lock-type-face)) ((use_as_clause path: (identifier) @font-lock-type-face) (:match "^[A-Z]" @font-lock-type-face)) ``` fixes it. Otherwise, I haven't noticed anything else amiss for the types fe= ature. The variable feature is highlighting some things incorrectly (it was before= too, but I think it's a little worse now). Adding these to rust-ts-mode--variable-p takes care of the issues that I se= e. ``` ((equal "extern_crate_declaration" parent-type) nil) ((equal "lifetime" parent-type) nil) ((equal "scoped_type_identifier" parent-type) nil) ((equal "use_as_clause" parent-type) nil) ((equal "use_list" parent-type) nil) ```