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.devel Subject: Re: Status update of tree-sitter features Date: Thu, 29 Dec 2022 02:34:47 +0200 Message-ID: <0f099d93-64c3-59be-9d5d-9b23ca1ecd2e@yandex.ru> References: <5d53b299-14e1-6f8b-58b3-7e16842d87a9@yandex.ru> 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="26163"; 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: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 29 01:35:35 2022 Return-path: Envelope-to: ged-emacs-devel@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 1pAgtS-0006dw-UJ for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Dec 2022 01:35:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAgsp-0002gZ-9s; Wed, 28 Dec 2022 19:34:55 -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 1pAgsn-0002gQ-6l for emacs-devel@gnu.org; Wed, 28 Dec 2022 19:34:53 -0500 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAgsl-0007F5-3Z for emacs-devel@gnu.org; Wed, 28 Dec 2022 19:34:52 -0500 Original-Received: by mail-wm1-x32c.google.com with SMTP id bg10so12225734wmb.1 for ; Wed, 28 Dec 2022 16:34:50 -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=KAzsA/7nNntNj+X3M7eGFzwM0MXWXfMgu+w1u30/DGI=; b=LA8lddltdXVo0tb3GE/DTxBcysnBitOSAGats+O8nfp26vXWMxA/cZCfSmVdc/eJJZ IcuHPEuYcB0n9TlQJuuodrdWVxASUcc7LIuBuA1bOY7XnsQag+T+IuM4ic8HG86fgG1j tc487rUEahvgb0dIeYiYGAuFFxq9c8rHuj8txRJ1YPrnOE5P9K9mqykatqD+PEAu+VZ0 Ovm4xUwp0cA1OrfCq9jZgvvyGEOtUpD42nMMC8yLJywUw7cZpQKd4d3whPM9j7bGYqcU e07ccyuAkN7T/pzxkfOoxsKBESFwBeDMiCX/OIWPlUZ4vMUFL1NAokokge4Fh/NQ/0Nx gZyg== 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=KAzsA/7nNntNj+X3M7eGFzwM0MXWXfMgu+w1u30/DGI=; b=COcd+K6+YD0/ME63RbIXKV8s+uYdm1mm/Q0SJ1/A0pPzlSQLhoE1pCI2vp3tP+jd7E k/GS8//7uUiWK1/+2S/4hs0OLG2ZkOQZ/sc1SLoDGFWYZybLMxdbghqS4eUcC4PR3N4u PVftFnGMLlQePPQclcbSo39PQRIb3aw9rGhZZvCaKyz87XHrhrHgxWGaO2KZjb2YmO3p mJq2s/NgB+CJml7x08WCr8HA1sa010Fa1lPd33IHM8XzEBmkoq9k+q/utmE887xxFOUD LYcB6RuE9wxgS29/YVF8FWvcsn+ByF2PZ4e6Az0Is4dUkIBYgO3RwSoHCRkOh/uUNg0C JCeg== X-Gm-Message-State: AFqh2kpvFojH69yKtl2HTH5o+YW/y1KL3kZUitn19KJ5nQkScTSKKaeg EgNmCe5KKNEbPzv/rHIPOLE= X-Google-Smtp-Source: AMrXdXt6gzXIuOyC75bOMBhM00mxxX14652eJSjjZwTDybC64zcAx8JjQQWKzk+InnK2fzV1+v5zGQ== X-Received: by 2002:a7b:cd08:0:b0:3d3:5c9e:6b27 with SMTP id f8-20020a7bcd08000000b003d35c9e6b27mr19299568wmj.12.1672274089352; Wed, 28 Dec 2022 16:34:49 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h6-20020a05600c350600b003d990372dd5sm6899959wmq.20.2022.12.28.16.34.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 16:34:48 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-1.147, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302019 Archived-At: On 29/12/2022 02:23, Yuan Fu wrote: >>> function every function identifier >> >> The description makes it easy to mistake for function definitions as well. Whereas the place where this category is used is function/method calls, right? And perhaps some other references to methods inside the code where the language parser can distinguish those from property access, etc. >> >> If it's only about calls, maybe call this category funcall? > > Function, property and variable are for every occurrence of them (the touted “consistent highlighting”). So there will be a bit of overlap between function, variable, and definition. By "overlap", do you mean that font-lock rules should also have entries for variable/function definitions with category 'variable'/'function'? In case somebody removes 'definition' from their list of enabled features but keeps 'variable' and 'function' there? >>> variable every variable identifier >> >> 'variable', so far, seems like the least useful. When enabled, it lights up every bit of text that remained from other matchers -- because identifier are everywhere. > > Yes, but apparently people want it ;-) Well, if they really do. I figured that people who added this maybe haven't tested this thoroughly. And that maybe they expected the effect of that "local variables highlights" feature that some editors showcase already. >> There is this more advanced prior art for highlighting variables, by tracking the scopes using custom annotations, see locals.scm here: >> >> https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables >> >> What's displayed under "Result" would be really handy to have in Ruby. >> >> It's nothing urgent, of course. Maybe for Emacs 30? > > Yeah, this requires some non-trivial addition to the current fontification code. Thank you. >> For Emacs 29, though, I would discourage the use of 'variable’. > > It’s on level 4, meaning not enabled by default, so I think it’s fine. Fair enough. If someone wants function/property but not variable, they could fine-tune the list.