From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Standardizing tree-sitter fontification features Date: Mon, 5 Dec 2022 13:17:42 -0800 Message-ID: <17C45AC9-EA54-4E19-BE8F-E400DAC78AE1@gmail.com> References: <88CEDB6E-AD74-4B18-81DE-F6A3436B5851@gmail.com> <46533EA2-1CC5-40E8-8726-94A0BAD0C919@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Randy Taylor Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 05 22:18:52 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 1p2IrU-0003GV-Je for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Dec 2022 22:18:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2Iqb-00019N-P5; Mon, 05 Dec 2022 16:17:57 -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 1p2IqS-000191-Ha for emacs-devel@gnu.org; Mon, 05 Dec 2022 16:17:56 -0500 Original-Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2IqQ-00026W-NE for emacs-devel@gnu.org; Mon, 05 Dec 2022 16:17:48 -0500 Original-Received: by mail-pj1-x1033.google.com with SMTP id t17so12461954pjo.3 for ; Mon, 05 Dec 2022 13:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3Uh4axIwe6VodEMJx6AuTQpqi8kDh0jhxlgbvwW7a8E=; b=Y4p+hr2+LUqFCLrVNBSwbLmy2hRItUmYXNhy+D1P+7nyMVh5taB5JLn/Fl64k3eNat T+yHHXZDZLrcwZ7OOnW/HWJj9s+f8VPJjimZsNRoDGr4CYo9m4c/XGHZk5CKh742yN2Z ivM6kBi8ia0vyo22Z0Ze5nCbeXBygENn92wtoxoxR5HQDMvR5EhYFFBWSl4UTeefbYXL m7TgxyV4yDWrO5Gxu27/1u55x+hw87ufjhOSVNnekd2MRyrQQWjxcI+HchYLmhhzg86o mc/rp2IJKY5p+BjwwQL1Jtg/aId6RKVMyD0K4rxKJx5Q3J4qRKUE0QdSbcazAvhBznM6 eJog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Uh4axIwe6VodEMJx6AuTQpqi8kDh0jhxlgbvwW7a8E=; b=jWlz5hTyLKPA6Z0a1S/U1km3XTxN0gVqPlBf9GwC/D1sc3NQE6X95ysOxciO492Jp0 QcdpAzJH6GfzqNKxGtKmB4HIQP3AMUWkrTlOaFMU0HrkBSnJtzgwPNnrij1c6n6szQM8 tnA/0qbsN1rZpyMqHqp4FC0fchPyPv5nVYW/+VzbV93gzGuFK2lwUgBXG3p5Znyhe2tV fEXrHRMfKcM3WnANnhtym6tSeO0lWrEjbPo/MP7eowXm7xowv57s8bgfoZncHdcj+d3f YxcslEf0tBs337LiDh9N78UmcJ8Qxb/C6eS7HC2iQjFUDvxeLgVcoXGcWtUDGq6Q7OAU lAbg== X-Gm-Message-State: ANoB5plfMTiCSPWKI57jeNzqVb491oAZMvxPSdfPL0/y5zb7aJX4qQ3T H/W1sSqE/p1ophUf1SUfwsCVzBGiv823xg== X-Google-Smtp-Source: AA0mqf4z+8e+5eWDcQGQWpkXf7YG5E5Db/iylGmtUZig29w3deOsskfOYWxHSjwbpnIKZLrLZi1zxQ== X-Received: by 2002:a17:903:152:b0:189:6bad:3c61 with SMTP id r18-20020a170903015200b001896bad3c61mr51118865plc.41.1670275065101; Mon, 05 Dec 2022 13:17:45 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id bv5-20020a17090af18500b00219e38b42f5sm905920pjb.26.2022.12.05.13.17.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2022 13:17:44 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=casouri@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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:300943 Archived-At: > On Nov 25, 2022, at 7:35 PM, Randy Taylor wrote: >=20 > On Friday, November 25th, 2022 at 15:55, Yuan Fu = wrote: >>=20 >>> On Nov 25, 2022, at 11:03 AM, Randy Taylor dev@rjt.dev wrote: >>>=20 >>> On Friday, November 25th, 2022 at 01:15, Yuan Fu casouri@gmail.com = wrote: >>>=20 >>>>> On Nov 24, 2022, at 5:13 PM, Randy Taylor dev@rjt.dev wrote: >>>>=20 >>>>> I wonder if assignment and definition are really worth having (and = would prefer to do without them), since they should be covered by the = variable, function, type and property features. >>>>=20 >>>> They are definitely useful. They are the things we currently = highlight, and for a reason. Personally I only want to highlight = identifiers in definition and assignment, not every occurrence of them. = Since so much of a program consists of variable and function = identifiers, highlighting all of them looks almost like highlighting = everything. I just want some visual cues on the program structure, not = programming in skittles :-) >>>=20 >>> Fair enough. In that case, are we going to end up with duplication = in the variable and function features? So long as I can program in = skittles, I am happy :). >>=20 >>=20 >> I don=E2=80=99t think duplication would be a problem. You can disable = them, or just left it on: the face would be the same, the difference is = only one which ones to highlight. >>=20 >=20 > I meant duplication in writing the queries. Variable and function = queries would already cover most or all of what's in assignment and = definition. >=20 >>=20 >>>>> - (maybe) literal instead of number? That way there is a group for = chars too (and any other literals if there are any?). Or a char feature = in addition to the existing number one. I'm undecided... >>>>=20 >>>> Literal seems to encompass numbers, strings, chars, and constants. = So I don=E2=80=99t know how does it fit. We could add char to string = feature. >>>=20 >>> Sounds good. I think I've seen char also end up in constant in some = of our tree-sitter modes. Doesn't matter to me where it goes. >>=20 >>=20 >> Hmm, what does neovim and emacs-tree-sitter do? (If you happen to = know) >>=20 >=20 > I'm not sure how the neovim stuff works, if it's faces they are = defining or features or what. But they get pretty granular, so they've = got their own thing for character (they even differentiate between = conditionals and loops!!!). emacs-tree-sitter isn't consistent. >=20 > I think it makes sense to include it in string though, just so long as = it doesn't have the same face. Perhaps the constant face is best for it? (Sorry I missed this message) C-mode uses string-face for chars, and I think it=E2=80=99s fine to use = string-face for chars, too. They already use different syntax (single = quotes), so they shouldn=E2=80=99t be hard to distinguish even with the = same face. Yuan=