From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties Date: Tue, 7 Feb 2023 20:16:54 +0200 Message-ID: <56a0b3d9-4a8f-0f81-83cb-6b78271dd782@yandex.ru> References: <6209c097-0369-828a-7513-d8afb73fd7f0@secure.kjonigsen.net> <5bd2f9f0-39d5-4d6b-815d-eda20d366441@app.fastmail.com> <32e34056-1a88-469a-819c-ae52e7d60712@app.fastmail.com> <3e40d23f-1629-c5b7-1f17-d769790d6494@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------W1f9yhJCvPPXGYTvN0eB9CZl" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: eliz@gnu.org, Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= , 61302@debbugs.gnu.org To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 07 19:18:28 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 1pPSXz-0005TY-5b for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Feb 2023 19:18:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPSXo-0007Xu-Ch; Tue, 07 Feb 2023 13:18:16 -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 1pPSXd-0007LR-Hf for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 13:18:14 -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 1pPSXa-0003kT-J5 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 13:18:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pPSXa-0003xv-6z for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 13:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Feb 2023 18:18: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.167579382615172 (code B ref 61302); Tue, 07 Feb 2023 18:18:02 +0000 Original-Received: (at 61302) by debbugs.gnu.org; 7 Feb 2023 18:17:06 +0000 Original-Received: from localhost ([127.0.0.1]:54024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPSWg-0003wd-2d for submit@debbugs.gnu.org; Tue, 07 Feb 2023 13:17:06 -0500 Original-Received: from mail-ej1-f46.google.com ([209.85.218.46]:39569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPSWd-0003vq-AI for 61302@debbugs.gnu.org; Tue, 07 Feb 2023 13:17:03 -0500 Original-Received: by mail-ej1-f46.google.com with SMTP id jg8so5221647ejc.6 for <61302@debbugs.gnu.org>; Tue, 07 Feb 2023 10:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=yBadEbFph4yH5Smf5P5Z/fUZqwVRduHBPnfXybd3Nd0=; b=ophUqJ66CL2rJGbibU3gRwuT6cqs+QdBrJgwA1SEpCLPtmnftJ0uSy5DMIbKvMzHWf OZTG6hL6G7UYZYKg2wjXh5334kJm+fotldy5UNcPlKOac4EM81OpIaKFYQzUWHGpDqOr wPHQY0klIozRe5/6o18mKqDzT9rI1JIJke91cKwC182h7hxCZ+HwD0KNmc6NU+lP+xN3 siyViIRkOqNhcrFjZ+1138wrsKHKFGi15peUDNx9Hd58kOvVulSpdMlfOJ6NtGL1fqNO h/KMmzoRBqnVM+DOaOKnRy/+0QuN8O4Jv9EE1hBz5/gTCzWAPLHHtyIjcCwJoFSuyx/v Khsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yBadEbFph4yH5Smf5P5Z/fUZqwVRduHBPnfXybd3Nd0=; b=1zPEv/F8EN5j3XRPg4xkPUW9bNWVVUYlwHFthA7cS3gA7clpAr2Og7GfAsqRaqJBxG xXh5gQvqb91iW/fn4cvtMmf+5CIM9zPvU7mMvmAqk5rSvD9c3rBfJKcRFkNfJYprmp1J fu0GZOGc1SGPI49qih0gSsu2kBczif9zff2d8P5xg7wYdwDrhqygVGUHLaISbt0JYb95 WNsZtaulOLg3MwWOHrffvMvz15soZep6bkfcklVBB9kFtajt708Z8if3S1p5ugicQoVI ZPbsM2sG9/taVym55o6cByErg/BFdx6PJ6BCpuOQiUPGd9XXDc2GEfrp5mhP83AtNP89 IRLg== X-Gm-Message-State: AO0yUKUeYHGn/6NTWZfam1kM8xLQaVacZQd5gKTiC6OtcbBo0898LZAZ 30DJVJIdqhGaNfipxkYf8a8= X-Google-Smtp-Source: AK7set/l7dxi6sIOa/sAo9va942/AgQKsEh+zrgLVSXHUbxFvxAFitkQCGhp+Pbcusr+MR8boakGKw== X-Received: by 2002:a17:906:4bd0:b0:882:cdd4:14d9 with SMTP id x16-20020a1709064bd000b00882cdd414d9mr3933649ejv.46.1675793817021; Tue, 07 Feb 2023 10:16:57 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id 13-20020a170906004d00b008512e1379dbsm7274523ejg.171.2023.02.07.10.16.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Feb 2023 10:16:56 -0800 (PST) Content-Language: en-US In-Reply-To: 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:255068 Archived-At: This is a multi-part message in MIME format. --------------W1f9yhJCvPPXGYTvN0eB9CZl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Randy. On 07/02/2023 16:26, Randy Taylor wrote: > I've given them a test spin. > > c/c++-ts-modes look good to me. > > go-ts-mode looks good to me. Very good. > rust-ts-mode looks good to me as well except the imports. Stuff like: > use std::fmt::{Display, Formatter}; > > is highlighted incorrectly. In the above example, std and fmt are highlighted as variables. This is a result of 'variable' being implemented as it is now -- highlighting all (identifier) nodes that no previous rule has matched. That makes things complicated when we try to support customizable highlighting level where the user can mix and match the enabled features. With imports, there was also another problem which I mentioned here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61205#68 If we highlight the imports as constants on level 3, when the 'function' feature is disabled, the function names will get highlighted with font-lock-constant-face as well. That seems undesirable. But -- and this just occurred to me today -- if we create a separate feature to add to level 4, with rules defined below 'function', that should satisfy all the constraints. > We should give them font-lock-constant-face. > > I will try to propose a patch later today unless someone beats me to it. Try the attached patch, please. On a distantly related note, we have terms like 'usize' which is normally a type (and highlighted as such), but can also feature in expressions like let row = usize::from_str_radix(row, 10).map_err(|_| error())?; where it is now highlighted with font-lock-constant-face. Should we try to do anything about that? If there is a limited number of built-in types in that situation (e.g. all of them primitives), we could handle that with a regexp. --------------W1f9yhJCvPPXGYTvN0eB9CZl Content-Type: text/x-patch; charset=UTF-8; name="rust-ts-mode-highlight-module.diff" Content-Disposition: attachment; filename="rust-ts-mode-highlight-module.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3J1c3QtdHMtbW9kZS5lbCBiL2xpc3AvcHJv Z21vZGVzL3J1c3QtdHMtbW9kZS5lbAppbmRleCA1YzcxYThhZDQ2MS4uZTJmMTk4NzA0ZjYg MTAwNjQ0Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3J1c3QtdHMtbW9kZS5lbAorKysgYi9saXNw L3Byb2dtb2Rlcy9ydXN0LXRzLW1vZGUuZWwKQEAgLTIzOSw2ICsyMzksMTkgQEAgcnVzdC10 cy1tb2RlLS1mb250LWxvY2stc2V0dGluZ3MKICAgICcoKGZpZWxkX2lkZW50aWZpZXIpIEBm b250LWxvY2stcHJvcGVydHktZmFjZQogICAgICAoc2hvcnRoYW5kX2ZpZWxkX2luaXRpYWxp emVyIChpZGVudGlmaWVyKSBAZm9udC1sb2NrLXByb3BlcnR5LWZhY2UpKQogCisgICA6bGFu Z3VhZ2UgJ3J1c3QKKyAgIDpmZWF0dXJlICdtb2R1bGUKKyAgICcoKHNjb3BlZF9pZGVudGlm aWVyIG5hbWU6IChpZGVudGlmaWVyKSBAZm9udC1sb2NrLWNvbnN0YW50LWZhY2UpCisgICAg IChzY29wZWRfaWRlbnRpZmllciBwYXRoOiAoaWRlbnRpZmllcikgQGZvbnQtbG9jay1jb25z dGFudC1mYWNlKQorICAgICAoc2NvcGVkX2lkZW50aWZpZXIKKyAgICAgIChzY29wZWRfaWRl bnRpZmllcgorICAgICAgIHBhdGg6IChpZGVudGlmaWVyKSBAZm9udC1sb2NrLWNvbnN0YW50 LWZhY2UpKQorICAgICAoc2NvcGVkX2lkZW50aWZpZXIKKyAgICAgIHBhdGg6IFsoaWRlbnRp ZmllcikgQGZvbnQtbG9jay1jb25zdGFudC1mYWNlCisgICAgICAgICAgICAgKHNjb3BlZF9p ZGVudGlmaWVyCisgICAgICAgICAgICAgIG5hbWU6IChpZGVudGlmaWVyKSBAZm9udC1sb2Nr LWNvbnN0YW50LWZhY2UpXSkKKyAgICAgKHNjb3BlZF91c2VfbGlzdCBwYXRoOiAoaWRlbnRp ZmllcikgQGZvbnQtbG9jay1jb25zdGFudC1mYWNlKSkKKwogICAgOmxhbmd1YWdlICdydXN0 CiAgICA6ZmVhdHVyZSAndmFyaWFibGUKICAgICcoKGlkZW50aWZpZXIpIEBmb250LWxvY2st dmFyaWFibGUtbmFtZS1mYWNlCkBAIC0zNDQsNyArMzU3LDggQEAgcnVzdC10cy1tb2RlCiAg ICAgICAgICAgICAgICAgICAoIGtleXdvcmQgc3RyaW5nKQogICAgICAgICAgICAgICAgICAg KCBhdHRyaWJ1dGUgYnVpbHRpbiBjb25zdGFudCBlc2NhcGUtc2VxdWVuY2UKICAgICAgICAg ICAgICAgICAgICAgbnVtYmVyIHR5cGUpCi0gICAgICAgICAgICAgICAgICAoIGJyYWNrZXQg ZGVsaW1pdGVyIGVycm9yIGZ1bmN0aW9uIG9wZXJhdG9yIHByb3BlcnR5IHZhcmlhYmxlKSkp CisgICAgICAgICAgICAgICAgICAoIGJyYWNrZXQgZGVsaW1pdGVyIGVycm9yIGZ1bmN0aW9u IG9wZXJhdG9yIHByb3BlcnR5IHZhcmlhYmxlCisgICAgICAgICAgICAgICAgICAgIG1vZHVs ZSkpKQogCiAgICAgOzsgSW1lbnUuCiAgICAgKHNldHEtbG9jYWwgdHJlZXNpdC1zaW1wbGUt aW1lbnUtc2V0dGluZ3MK --------------W1f9yhJCvPPXGYTvN0eB9CZl--