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: Mon, 6 Feb 2023 04:45:37 +0200 Message-ID: <3e40d23f-1629-c5b7-1f17-d769790d6494@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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19804"; 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, 61302@debbugs.gnu.org To: Randy Taylor , Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 06 03:46:34 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 1pOrWb-00051M-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Feb 2023 03:46:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOrWH-0007IM-OR; Sun, 05 Feb 2023 21:46:13 -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 1pOrWA-0007Dq-K7 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 21:46:08 -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 1pOrW6-0008CA-EQ for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 21:46:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOrW6-0004nn-4J for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 21:46: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: Mon, 06 Feb 2023 02:46: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.167565154818436 (code B ref 61302); Mon, 06 Feb 2023 02:46:02 +0000 Original-Received: (at 61302) by debbugs.gnu.org; 6 Feb 2023 02:45:48 +0000 Original-Received: from localhost ([127.0.0.1]:47025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOrVs-0004nI-1E for submit@debbugs.gnu.org; Sun, 05 Feb 2023 21:45:48 -0500 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:37680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOrVp-0004n5-Ts for 61302@debbugs.gnu.org; Sun, 05 Feb 2023 21:45:46 -0500 Original-Received: by mail-wm1-f49.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so9799956wmb.2 for <61302@debbugs.gnu.org>; Sun, 05 Feb 2023 18:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding: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=9wQeWObiYujcirmsAnyNY4UqaPApbYdKcuuv7FXFYts=; b=n0zz+1MPKAoTzZsysABmuGKzZwKtttncNpbc6dnBqNIWy9uJyFYEDqqafP5jlZ9Htl pUfkmr85vOfe1zRCmf3wouqap2m1ov7zRNT+iwDWTnPjntEo96nSi1jNuKBQzG2FbeCB 6ZWCYBeyEWyWbaszJ+Y6BqmZYGDcRRHgSJOgb9LNd0o6aYvgxN/kdoAAaPuFCqfqUS36 ikfPi4SPNRbVDy5itEmaBZA0tX0PaoKil896/HN0vHXDss1SLV4TUAkFO6GlxTDeu+20 7sExWRHrVfHE/Ba8kP1sKy2HQg/8VIV5OHPdRCZ4bHR4JjAjENfKNgZBGdQSSYL/q64L fQtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=9wQeWObiYujcirmsAnyNY4UqaPApbYdKcuuv7FXFYts=; b=ZY3TJGJA333Svl+C3RlGrVQivoyvZez955mH2wL6S8pWQ7WE7oG0LnkDxpLy02nsIY NYbWTjeuXPMp11HXubk7WFXi8v3ATpneIK77a8kEFivihn+h+YaosPo8KCddgjT+SCsz Sv/Qm7FdfHGGJ1VfnUYO83teSHviLF/b0UQccE4+djvmOe7CTK7nFlz2fQaxIAu3z5M9 CxHqT1NqxqZwOQ86KhcXoScxx0H0cFM439ozE0z8qi2qUaESQk04kkKDtd/l3xfcnEML sewXeHhxh6QLk/Jm5ImDtD10g/QPUxtCZMG3dN8fDw+4VWy5lvt5n7SCUm27VeBp0xYJ 3P3w== X-Gm-Message-State: AO0yUKVcxdoZSTfkKm3AGhYEA/GjhOhaHvImaCvy5bmlSGG4FEdosdgR x6USo4uepB34X8vaj/Ii4Tc= X-Google-Smtp-Source: AK7set+Lvf90hPCnFxA4ai05MmHlDKto5aBJE6eie3lNHuQ26HdjqkxtKKJOJklow/4LeCz4pG+CXA== X-Received: by 2002:a05:600c:3513:b0:3df:b5ae:5289 with SMTP id h19-20020a05600c351300b003dfb5ae5289mr14220048wmq.8.1675651539778; Sun, 05 Feb 2023 18:45:39 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p17-20020a05600c205100b003dd1bd0b915sm11580707wmg.22.2023.02.05.18.45.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Feb 2023 18:45:39 -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:254922 Archived-At: On 06/02/2023 03:50, Randy Taylor wrote: > On Sun, Feb 5, 2023, at 22:52, Jostein Kjønigsen wrote: >>> >>> On Sun, Feb 5, 2023, at 22:30, Randy Taylor wrote: >>>> >>>> That's expected (at least to me) because it's a property. The same applies to c-ts-mode and go-ts-mode as well. >>> I mean… yea it’s a property, but it’s clearly a function-valued property, and you’re calling it. >>> >>> Even simpler: If you store a function reference in a plain variable and call that variable, is that a variable or a function you’re calling? ;) >>> >>> As for consistency, csharp-ts-mode, js-ts-mode, typescript-ts-mode (and tsx-ts-mode) all does the  exact opposite: functions always takes precedence over properties. >>> >>> In fact, they mostly highlight declarations of properties only, not regular access, which kind avoids the duality-problem we’re seeing in rust-ts-mode in this particular case. >>> >>> Would it be an option/goal to try to align these other modes with a such a model which is somewhat more clearly defined to make it simpler  to resolve cases like this? > > When I introduced font-lock-property-face, I intended for it to be used > to highlight all properties. > > Clearly that's not what most people had in mind, and it seems that many > would prefer property functions (for lack of better term) be highlighted > as functions. > I can live with that, and yes, all the modes should be consistent so > Rust, Go, C/C++ and any anything else should be fixed up to abide. > I'll fix Go up sometime next week unless someone beats me to it. We're getting very close to when the pretest should be cut, I'm not sure if we have an extra week. We're probably pushing the limits of the feature freeze here already. I've pushed a fix for Go as well, it looked very similar to Rust's one. Curiously, in both cases the 'function' feature already contained the necessary rule (which matched only "property functions"), which then was later overridden by a rule in 'property' feature. > Perhaps in the future we can introduce more fine-grained options for > properties if it's desired. Sure, in case you or others really feel that need. There are several ways we could go about adding that capability. In the meantime, I've also added highlighting of variable declarations to go-ts-mode (to 'definition', so it's on feature level 3). This should finish bringing rust and go ts modes to parity with the rest. Please take it for a spin when you have the time. I'm not too familiar with Go, so I could have missed some cases. But hopefully not.