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#61655: [Tree sitter] [Feature Request] font-lock function calls, definitions, separately Date: Wed, 22 Feb 2023 23:39:10 +0200 Message-ID: <9de78a55-c0ea-ed32-979a-3c680c578d69@yandex.ru> References: <8DA1B548-B8D2-4EC1-B9F8-F7654003AC89@gmail.com> <56C0998E-3053-49F3-BAE3-46D6432B16F5@gmail.com> <7B23CCBC-9B9F-4E1A-AE5F-0DBDD2FE2C26@gmail.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="5113"; 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: Randy Taylor , Yuan Fu , 61655@debbugs.gnu.org To: Jacob Faibussowitsch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 22 22:40:21 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 1pUwqb-00019e-5K for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Feb 2023 22:40:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUwqL-0000cr-6p; Wed, 22 Feb 2023 16:40:05 -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 1pUwqI-0000cH-Sz for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 16:40: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 1pUwqH-0006Ho-Vi for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 16:40:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUwqH-0007mz-Ob for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 16:40: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: Wed, 22 Feb 2023 21:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61655 X-GNU-PR-Package: emacs Original-Received: via spool by 61655-submit@debbugs.gnu.org id=B61655.167710196029874 (code B ref 61655); Wed, 22 Feb 2023 21:40:01 +0000 Original-Received: (at 61655) by debbugs.gnu.org; 22 Feb 2023 21:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:60558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUwpb-0007lm-PA for submit@debbugs.gnu.org; Wed, 22 Feb 2023 16:39:20 -0500 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:37392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUwpZ-0007lZ-WA for 61655@debbugs.gnu.org; Wed, 22 Feb 2023 16:39:18 -0500 Original-Received: by mail-wr1-f53.google.com with SMTP id h14so477553wru.4 for <61655@debbugs.gnu.org>; Wed, 22 Feb 2023 13:39:17 -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=O4l6kKFO5tuJyxtJ9cxuIs+qJTGEKv1qWtL2tea/6IY=; b=jfB9/oKjyBmHqkraKNPrp3gbGBcK8fBHvLw/kfJJ3Bb72Zppaeu0U5vHiXJae7SaX3 CtxuypPy2iTBx6xdYu9m80KND41zbTEuBeF+iiIR2V+HodBXEiBpGN4110UsZg+lln3v sbosdzWKkWMrAr4e6yYP9ayfWwEbcYP6GxRrRZG7KTQx1GEa6g3TJbLZ4zygtyU4TCcW R/l7sjDUM3wfJuLlthZsVu3rp/zN/f94viKw0PW5lOLEoXPeNKShmZc+1BjPaEFEH32K a6ZkbOWb1CiPF8ZxmfZpdn8+xQcSIkNc3chtYxeM9IL+A4oRCa5KnkQq8meqjVhwEF3O OKTQ== 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=O4l6kKFO5tuJyxtJ9cxuIs+qJTGEKv1qWtL2tea/6IY=; b=Nm8uEgNN0y7w78DkXVvR3+rkhJNBui54T7zIT9h/k/mw/UOszrMRzOaGCeCUhJTX0f VyDHwgYajtOSmnlyfH8atH/sb2P1wqsqRjd07n4ahpJWEGtrmuVXUVi6Qpg0oNxcB0Xb FmmgEM+Me3zujeHnlquVOqTw57ShL8xUWN+v+blnAWo1n8vwDtkmtGUJRy06ZikUli1E MPQPsCrbTJEPrTZzDWpPqemI/S5hNG17aRGzjtl2hZ97dQ+35yBGkcpAy5TE1/MKWO95 4+xWNC9hbsuyhf4J7/fC/sKmKubULWF1mp7fLzqSkPrzBD/OMe0Yk1aqnbO8OBJhg5JT HLzA== X-Gm-Message-State: AO0yUKWiuvGgNcQMQLBZ2iesJExtAIpj9ZVkcF56ncj8twm/dmfTnTPf +qXqP+rv6MgJPXNjw8kqDZ8= X-Google-Smtp-Source: AK7set/6xrT1nWqtoUbeLVOd/RKFHYTMzBtpD8uLBeI2c8HHOuhwCs2Wfo3pvzpux6zvnxZxGOJZvQ== X-Received: by 2002:adf:dece:0:b0:2c5:544b:8e64 with SMTP id i14-20020adfdece000000b002c5544b8e64mr8252964wrn.71.1677101952345; Wed, 22 Feb 2023 13:39:12 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id z1-20020a5d4c81000000b002c560e6ea57sm8155845wrs.47.2023.02.22.13.39.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Feb 2023 13:39:11 -0800 (PST) Content-Language: en-US In-Reply-To: <7B23CCBC-9B9F-4E1A-AE5F-0DBDD2FE2C26@gmail.com> 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:256400 Archived-At: On 22/02/2023 20:07, Jacob Faibussowitsch wrote: >> What's a "member function"? Is it like a method? > Yeah, I suppose method is the more general term for it. > >> If people want this distinction, we can add such face. But I'm curious whether some other editors use different colors for these cases. > I personally do not; I brought it up because it was functionality that the 3rd party package had over stock. I think a good representative list is the one vscode offers: > > https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers > >> I'm also wondering what face we're supposed to use for "receiver-less" method calls, such as calls to the methods defined in the same class, in e.g. Ruby and Java. Or C++/C#. They don't use ‘this’. > I don’t think emacs should worry about differentiating these cases. Highlight those tokens as tree-sitter sees them; regular function calls (i.e. `font-lock-function-call-face`). It’s a problem you cannot accurately solve without playing the compiler — with all of the implementation and not to mention performance baggage that comes with it. > >> I also wonder whether we'll need to separate faces for properties: definitions vs. uses. That one we could use to do early, to keep the names uniform, e.g. we'd have: > This is something (also 3rd party package) lsp-mode supports through their semantic highlighting. They further distinguish between read and writes to variables. But again, they are able to do so because they hook directly into compilers. Thank you, then I guess we can skip that distinction, at least for now.