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, 13 Feb 2023 22:49:56 +0200 Message-ID: <50e1cbf9-7d55-d0df-ad01-521de1a4a51c@yandex.ru> References: <6209c097-0369-828a-7513-d8afb73fd7f0@secure.kjonigsen.net> <56a0b3d9-4a8f-0f81-83cb-6b78271dd782@yandex.ru> <3dc0ab0a-b0b1-91b8-f393-8db3899cf956@yandex.ru> <05ee38a5-f783-5b2c-add6-ee2ea27ba297@yandex.ru> <8a58c831-d8e6-c5b8-67b0-c606b2b3f189@yandex.ru> <48016e5e-71e0-c94f-4927-ee0c7b2aaa1e@secure.kjonigsen.net> <004dc5d0-7062-bda1-8a14-2bf16d986e24@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15872"; 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@kjonigsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 13 21:51:25 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 1pRfnI-0003ye-NF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Feb 2023 21:51:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRfn3-0005yF-M2; Mon, 13 Feb 2023 15:51:09 -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 1pRfmw-0005q7-Ef for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2023 15:51: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 1pRfmv-00060z-OF for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2023 15:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRfmv-0007Qi-JP for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2023 15:51:01 -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, 13 Feb 2023 20:51: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.167632140928484 (code B ref 61302); Mon, 13 Feb 2023 20:51:01 +0000 Original-Received: (at 61302) by debbugs.gnu.org; 13 Feb 2023 20:50:09 +0000 Original-Received: from localhost ([127.0.0.1]:51788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRfm5-0007PK-HM for submit@debbugs.gnu.org; Mon, 13 Feb 2023 15:50:09 -0500 Original-Received: from mail-ej1-f41.google.com ([209.85.218.41]:43982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRfm3-0007Ot-Sg for 61302@debbugs.gnu.org; Mon, 13 Feb 2023 15:50:08 -0500 Original-Received: by mail-ej1-f41.google.com with SMTP id k16so3439366ejv.10 for <61302@debbugs.gnu.org>; Mon, 13 Feb 2023 12:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=M2SS5TeqxfzF22D3OQ+ZtAgzllsVjE0yOdui/raa8iw=; b=mMqZTomPHRh1Zkz2IxoayzqFwjv2E0wmfqmi0nGuaV6ZIo2hMlDD9985zFom6c3ni0 xlhZMrqVJdPZntPQGIK3Wnkmv4KqTy6VrG6Xahf2mqPFlBs3zvbxXwLgkEs2zt/jAQpj 5z8i+y1oQLmFkd4u5RhMNBF73GET0TbH0WhO1CU1M69aR5ZfTntQSrofjMplXxbJlFgv ERLVcKnA5UkoUY4JbcngnBFs2CDtr6WYPLkwUICMAD9tIgYgxf2Qqdz77qnayr1++cHw 6cEL2APkAYPLXfHFpR6EsJZiSbv/IbY6VO8C4e3TqL69nbq7tizj3VRrYNy2C6u2THtC rUjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :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=M2SS5TeqxfzF22D3OQ+ZtAgzllsVjE0yOdui/raa8iw=; b=sTkWYhEZLcxtH6k+N760PX5iXH1nOU3HRARukHNLoCjDe7vBWAmFfCotjGEM5ZrI9S UCPsqR7hfcUfHBFFvw8WqlYvkahWVBIjjfW/eAxljm7Ql0PxJtqL6Lj9JvBKwnvjlJSH y6BB/hiRlQ6v/O6/7exdCHGcPanFB+aJq5sMEvW5w+hM7QrsMLVHTjucZLf3S///9J1F erccH5e/s0nDWsP1ChzCov4MqfxHtlDhIahBsQE2Vsajeme91vzG8LoGlVHMNV5iXOVJ 2QgttZJ8mT9zep+sE3W7M+6vrt6okCirBCDja3nunL8JIrwwe6ASl0yoogH0nKyJw8qj BdMQ== X-Gm-Message-State: AO0yUKWQrucNU17k4GQBiZh3l1XqgP4vG2nFqaZG+zKeO8FBz/mczl+o rmJvnaiCFBSYqLC1KpAvxCI= X-Google-Smtp-Source: AK7set/16Y9AinS9KNyrh8GwC2qyVElAzEcOXCzQiAwX/5rkyBR/qJ6t3NY6Nw52zXNloZod9znMfA== X-Received: by 2002:a17:906:164a:b0:878:7449:429f with SMTP id n10-20020a170906164a00b008787449429fmr311135ejd.16.1676321401683; Mon, 13 Feb 2023 12:50:01 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v1-20020a170906b00100b0087862f45a29sm7279782ejy.174.2023.02.13.12.49.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Feb 2023 12:50:01 -0800 (PST) Content-Language: en-US In-Reply-To: <004dc5d0-7062-bda1-8a14-2bf16d986e24@yandex.ru> 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:255529 Archived-At: On 13/02/2023 21:57, Dmitry Gutov wrote: > I didn't bother with assignments for now (in the absence of feature > requests), but they should be even easier to add. E.g. like this: diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 5c71a8ad461..f105c894b28 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -163,11 +163,15 @@ rust-ts-mode--font-lock-settings (macro_definition "macro_rules!" @font-lock-constant-face) (macro_definition (identifier) @font-lock-preprocessor-face) (field_declaration name: (field_identifier) @font-lock-property-face) - (parameter) @rust-ts-mode--fontify-pattern - (let_declaration) @rust-ts-mode--fontify-pattern - (for_expression) @rust-ts-mode--fontify-pattern - (let_condition) @rust-ts-mode--fontify-pattern - (match_arm) @rust-ts-mode--fontify-pattern) + (parameter pattern: (_) @rust-ts-mode--fontify-pattern) + (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern) + (for_expression pattern: (_) @rust-ts-mode--fontify-pattern) + (let_condition pattern: (_) @rust-ts-mode--fontify-pattern) + (match_arm pattern: (_) @rust-ts-mode--fontify-pattern)) + + :language 'rust + :feature 'assignment + '(((assignment_expression left: (_) @rust-ts-mode--fontify-pattern))) :language 'rust :feature 'function @@ -261,7 +265,7 @@ 'rust-ts-mode--fontify-pattern (treesit-available-p) `(lambda (node override start end &rest _) (let ((captures (treesit-query-capture - (treesit-node-child-by-field-name node "pattern") + node ,(treesit-query-compile 'rust '((identifier) @id (shorthand_field_identifier) @id))))) (pcase-dolist (`(_name . ,id) captures) @@ -343,7 +347,7 @@ rust-ts-mode '(( comment definition) ( keyword string) ( attribute builtin constant escape-sequence - number type) + number type assignment) ( bracket delimiter error function operator property variable))) ;; Imenu.