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: Fri, 25 Nov 2022 12:55:48 -0800 Message-ID: <46533EA2-1CC5-40E8-8726-94A0BAD0C919@gmail.com> References: <88CEDB6E-AD74-4B18-81DE-F6A3436B5851@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="24475"; 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 Fri Nov 25 21:56:36 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 1oyfkS-0006A5-7d for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 21:56:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyfjm-0002GM-Sw; Fri, 25 Nov 2022 15:55:54 -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 1oyfjm-0002G7-5w for emacs-devel@gnu.org; Fri, 25 Nov 2022 15:55:54 -0500 Original-Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyfjk-0008GA-E6 for emacs-devel@gnu.org; Fri, 25 Nov 2022 15:55:53 -0500 Original-Received: by mail-pj1-x1032.google.com with SMTP id b13-20020a17090a5a0d00b0021906102d05so3616738pjd.5 for ; Fri, 25 Nov 2022 12:55:51 -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=Z60a17g/9gRRZ6kwR+kFeq8Nv/fXeYPtGzVgoyGCfmg=; b=eCVOImAfZAXGJ4ocH38royZUVasPijwJ0EcWKdCFHiGafIcBOr8fIrsmlY6gm28hd6 sxhXsBX2n2JwcUonFdUm7r3RoBw5QR37I+w6Xm3aKLayOP56V7qcCtUe6DcgAvBhoKr0 kW/91aUyvRoVqcRZvH8249QSQSxv2cd1vz1pWqS6p48ERN0y+3b8TqxhCpZkg/O0HeVZ 4sMOIhHtq9GqWTtFwqXw8qRlZjVlBgDap+wXWYEkam8L3OJcNHtOF5jaQRuboC2SY+sU JH0YKzzp1RaYur5sTZPGzxVdp+vm5zwTQ+xWBJFmKp04YF6Wr9MTZOEHXRExQw0qBV1W 2mZg== 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=Z60a17g/9gRRZ6kwR+kFeq8Nv/fXeYPtGzVgoyGCfmg=; b=tzvr9n3Sms8k4rEB4WI8jqmzDbQWevZnDBAKby83SpwJb+XQ6jSuM0cQAI6QZ6fT5+ 01Wjg4lhliRt0lfPkspdmrugepXIPCKFBGc8WGIn/Wr/I44m+TQ/L57dsurL65D8FKrp NALEj43Y1hEWRo2fxIgdEuDwP391GxCpOEme3iK4N7BLadJaP6/4BeawsM5GTlg320Pv 9Jipa7emvoH6Lt3X8vXlp05xbkY9ABSbD0vlCgqnZ/lR39yS/WHkrJiLh7IsSj7JTZA3 Pi4mygCnW6NinwZE6umdb7bcPwtYGwsNEhxS+UoT3mTPo/gx7f7HknrwxZYVgGdgF3GZ fztQ== X-Gm-Message-State: ANoB5pnylT72oBsbBKAnIXtjC8Wcfc3v5c/+m7NIHzyJR4GV6pp06cE2 NmYYAWN67v+NKmNTfE74hjU= X-Google-Smtp-Source: AA0mqf5EfffEXZalMj1HKMPE2vlDrBGrh4O8qbnMu57x2zXigRHHPRUWYEc+L1dDj/Q0k345meyMNQ== X-Received: by 2002:a17:90a:b706:b0:212:e75b:1602 with SMTP id l6-20020a17090ab70600b00212e75b1602mr42008471pjr.139.1669409750123; Fri, 25 Nov 2022 12:55:50 -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 k5-20020aa79985000000b0056ba6952e40sm3488713pfh.181.2022.11.25.12.55.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2022 12:55:49 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=casouri@gmail.com; helo=mail-pj1-x1032.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:300523 Archived-At: > On Nov 25, 2022, at 11:03 AM, Randy Taylor wrote: >=20 > On Friday, November 25th, 2022 at 01:15, Yuan Fu = wrote: >=20 >>=20 >>> On Nov 24, 2022, at 5:13 PM, Randy Taylor dev@rjt.dev wrote: >>>=20 >>=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 >>=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 :). 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 would also add: >>> - misc-punctuation, for anything not considered a delimiter or = bracket. Most modes would use this for any special punctuation they've = got. >>=20 >>=20 >> Is there any examples? Maybe just merge delimiter and punctuation = together? >>=20 >=20 > Yes, see sh-script.el. $ is used for misc-punctuation. neovim and the = Emacs dynamic module tree-sitter implementation have more examples (they = call it special punctuation). >=20 > I think we should keep them all separate. Ok, then delimiter and misc-punctuation it is. >=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 >>=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 >=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. Hmm, what does neovim and emacs-tree-sitter do? (If you happen to know) >>> Maybe a slight tangent but I also suggest we alphabetize all of = these; both the queries and the list of features. I'll send a patch to = do that myself once things cool down a bit. Although anything that = overrides will need to go at the bottom to make sure it gets applied. >>=20 >>=20 >> Good idea :-) A tangent of your tangent: how did you alphabetize = them? Did you use the sort-word package on EmacsWiki? >>=20 >> Yuan >=20 > Manually ;) (except for the keyword and such lists, those I use the = built-in sort-lines on). I really like saying the alphabet over and = over. Well that=E2=80=99s a very convenient hobby :-) Yuan