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: Wed, 15 Feb 2023 02:07:19 +0000 Message-ID: References: <6209c097-0369-828a-7513-d8afb73fd7f0@secure.kjonigsen.net> <33cec9a6-7e69-2eb3-a8a6-58ce23a5c185@yandex.ru> <61cb2b34-0be2-1f69-e72d-5351fbe9e48f@yandex.ru> <5075852e-480b-7ca9-ba46-8de230ed8df5@secure.kjonigsen.net> <6b75a99f-05fd-cde9-e9fe-7191f12d72e1@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_wShRyP15NKRUHSq2UChJpjqax2fYfJWJ2ktAjfmLU" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37279"; 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 Wed Feb 15 03:09:23 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 1pS7EZ-0009Sk-9t for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 03:09:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS7DK-0003g0-SA; Tue, 14 Feb 2023 21:08:06 -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 1pS7DH-0003dC-2b for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 21:08:04 -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 1pS7DG-0000Wv-8g for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 21:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pS7DF-0002CJ-Q2 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 21:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 02:08:01 +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.16764268538408 (code B ref 61302); Wed, 15 Feb 2023 02:08:01 +0000 Original-Received: (at 61302) by debbugs.gnu.org; 15 Feb 2023 02:07:33 +0000 Original-Received: from localhost ([127.0.0.1]:57474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS7Cn-0002BX-80 for submit@debbugs.gnu.org; Tue, 14 Feb 2023 21:07:33 -0500 Original-Received: from mail-4317.proton.ch ([185.70.43.17]:40827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS7Cl-0002BJ-Qu for 61302@debbugs.gnu.org; Tue, 14 Feb 2023 21:07:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1676426845; x=1676686045; bh=IRtPz7qhVbpunrPvInh41MD2Gqp/XdAkVwbjB9K+yAw=; 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=bSTdymJAHV3fIdbU2qAPh9qrFfQV6SJx26Zor9jIZswvD7LLupQCM+D2d5wfnxaj/ LW7pdqynE199iXTfJv6E80kPs78jKOF0ItT0fT8OjUy7gW+xCeUMy5E2ABaYaCIsQw dumDYVzGS/LUi5nQq/XpvHbcPLPc3MJ9ZAsREt4LToIxJnQ8LIE2QzdV/G8iJdk5aW muW4bmD0yxNaPqprp6LaLoQ6SvUWqIyWCpo5V/79g2fJCr6m76B67OnXEZEkRanopq QBIA5KxaDTMGxxFHLEJ0+muhLqK06MDsr6E1S+YG5S3SQFSYI07vSDAqt5Q/ROaL+I ZpG62XaaT+sfw== In-Reply-To: <6b75a99f-05fd-cde9-e9fe-7191f12d72e1@yandex.ru> 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:255657 Archived-At: This is a multi-part message in MIME format. --b1_wShRyP15NKRUHSq2UChJpjqax2fYfJWJ2ktAjfmLU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tuesday, February 14th, 2023 at 17:14, Dmitry Gutov w= rote: > On 14/02/2023 14:39, Randy Taylor wrote: >=20 > > On Tuesday, February 14th, 2023 at 06:42, Jostein Kj=C3=B8nigsen > > jostein@secure.kjonigsen.net wrote: > >=20 > > > Haven given the latest patch a try on a less macro-ridden codebase I = have to > > > say it looks a lot better. In general I would say for this other > > > code-base it looks favourable to rust-mode. > > >=20 > > > If there's one thing which still seems to be done better in rust-mode > > > (not nitpicking the variable highlighting), it would be fully namespa= ces > > > function calls within classes. > > >=20 > > > Consider the following code: > > >=20 > > > extern crate claxon; > > > let result =3D claxon::FlacReader::open(path); > > >=20 > > > While rust-ts-mode correctly identifies that open() is a function-cal= l, > > > rust-mode correctly identified FlacReader as a class. > >=20 > > Thanks for testing. I've attached a patch fixing this. > >=20 > > I had deleted a query I thought was now covered :). I look forward to > > the day we have highlight tests! >=20 >=20 > Thank you, looks almost perfect (see below), I've pushed that to emacs-29= . Thanks! >=20 > Highlighting tests are a pain to write, but the initiative is always > welcome. ;-) In the meantime, at least tree-sitter validates the > queries, which lowers the odds of typos in font-lock rules. >=20 > Speaking of a problem, the solution with applying the explicit 'default' > face doesn't seem ideal. Aside from the redundancy in the resulting > buffer structure (with very little practical downside), it also makes > the 'vc-diff' buffers look like this on the attached screenshots (the > 'default' face's background overrides the greens and reds). >=20 > I couldn't find a quick solution to this problem, so I pushed the > existing code for now. The following patch fixes it for me, but it's a hack since the face doesn't= exist (and I don't think the override option matters for the current patch= either, I only realized these things as I was about the send the email). I tried using 'default with all the different override options and nothing = worked. Yuan, any ideas? Basically what we have here are general scoped_identifier queries that we w= ant to apply only to the actual code (i.e. not imports). However, these sco= ped_identifiers also exist in the imports and the same highlighting semanti= cs don't apply there, so we have specific queries for the different kinds o= f imports that specify how they want their scoped_identifier stuff highligh= ted. For some of those specific queries, we want to leave the face as it an= d make sure nothing else gets applied to it (i.e. default is what we want).= Apparently that causes issues with vc-diff buffers, and maybe other things= we have yet to discover. --b1_wShRyP15NKRUHSq2UChJpjqax2fYfJWJ2ktAjfmLU Content-Type: text/x-patch; name=0001-Fix-rust-ts-mode-highlights-overriding-vc-diff-buffe.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-Fix-rust-ts-mode-highlights-overriding-vc-diff-buffe.patch RnJvbSBiZDQwNWFiOWRjMWIwMmQ3NmY1NmE5NGI5ODRiN2JlYTllNTk3YmMyIE1vbiBTZ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dGNoICJeW0EtWl0iIEBmb250LWxvY2stdHlwZS1mYWNlKSkKLSAgICAgKHVzZV9hc19jbGF1c2Ug cGF0aDogKHNjb3BlZF9pZGVudGlmaWVyIG5hbWU6IChpZGVudGlmaWVyKSBAZGVmYXVsdCkpCisg ICAgICh1c2VfYXNfY2xhdXNlCisgICAgICBwYXRoOiAoc2NvcGVkX2lkZW50aWZpZXIgbmFtZTog KGlkZW50aWZpZXIpIEBydXN0LXRzLW1vZGUtLWZvbnRpZnktZGVmYXVsdCkpCiAKICAgICAgKCh1 c2VfZGVjbGFyYXRpb24KICAgICAgICBhcmd1bWVudDogKHNjb3BlZF9pZGVudGlmaWVyCkBAIC0y MjYsMTQgKzIyNywxNCBAQCBydXN0LXRzLW1vZGUtLWZvbnQtbG9jay1zZXR0aW5ncwogICAgICAg KDptYXRjaCAiXltBLVpdIiBAZm9udC1sb2NrLXR5cGUtZmFjZSkpCiAgICAgICh1c2VfZGVjbGFy YXRpb24KICAgICAgIGFyZ3VtZW50OiAoc2NvcGVkX2lkZW50aWZpZXIKLSAgICAgICAgICAgICAg ICAgbmFtZTogKGlkZW50aWZpZXIpIEBkZWZhdWx0KSkKKyAgICAgICAgICAgICAgICAgbmFtZTog KGlkZW50aWZpZXIpIEBydXN0LXRzLW1vZGUtLWZvbnRpZnktZGVmYXVsdCkpCiAKICAgICAgKHVz ZV9kZWNsYXJhdGlvbgogICAgICAgYXJndW1lbnQ6IChzY29wZWRfaWRlbnRpZmllcgogICAgICAg ICAgICAgICAgICBwYXRoOiAoc2NvcGVkX2lkZW50aWZpZXIKICAgICAgICAgICAgICAgICAgICAg ICAgIHBhdGg6IChfKSBAZm9udC1sb2NrLWNvbnN0YW50LWZhY2UKICAgICAgICAgICAgICAgICAg ICAgICAgIG5hbWU6IChpZGVudGlmaWVyKSBAZm9udC1sb2NrLWNvbnN0YW50LWZhY2UpCi0gICAg ICAgICAgICAgICAgIG5hbWU6IChpZGVudGlmaWVyKSBAZGVmYXVsdCkpCisgICAgICAgICAgICAg ICAgIG5hbWU6IChpZGVudGlmaWVyKSBAcnVzdC10cy1tb2RlLS1mb250aWZ5LWRlZmF1bHQpKQog CiAgICAgICh1c2VfZGVjbGFyYXRpb24KICAgICAgIGFyZ3VtZW50OiAoc2NvcGVkX3VzZV9saXN0 CkBAIC0yNDMsMTIgKzI0NCwxMiBAQCBydXN0LXRzLW1vZGUtLWZvbnQtbG9jay1zZXR0aW5ncwog CiAgICAgICgodXNlX2xpc3QgKGlkZW50aWZpZXIpIEBmb250LWxvY2stdHlwZS1mYWNlKQogICAg ICAgKDptYXRjaCAiXltBLVpdIiBAZm9udC1sb2NrLXR5cGUtZmFjZSkpCi0gICAgICh1c2VfbGlz dCAoaWRlbnRpZmllcikgQGRlZmF1bHQpCisgICAgICh1c2VfbGlzdCAoaWRlbnRpZmllcikgQHJ1 c3QtdHMtbW9kZS0tZm9udGlmeS1kZWZhdWx0KQogICAgICAoKHVzZV9saXN0IChzY29wZWRfaWRl bnRpZmllciBwYXRoOiAoXykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFt ZTogKGlkZW50aWZpZXIpIEBmb250LWxvY2stdHlwZS1mYWNlKSkKICAgICAgICg6bWF0Y2ggIl5b QS1aXSIgQGZvbnQtbG9jay10eXBlLWZhY2UpKQogICAgICAodXNlX2xpc3QgKHNjb3BlZF9pZGVu dGlmaWVyIHBhdGg6IChfKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6 IChpZGVudGlmaWVyKSBAZGVmYXVsdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbmFtZTogKGlkZW50aWZpZXIpIEBydXN0LXRzLW1vZGUtLWZvbnRpZnktZGVmYXVsdCkpCiAg ICAgICh1c2Vfd2lsZGNhcmQgKHNjb3BlZF9pZGVudGlmaWVyCiAgICAgICAgICAgICAgICAgICAg IG5hbWU6IChpZGVudGlmaWVyKSBAZm9udC1sb2NrLWNvbnN0YW50L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