From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.devel Subject: Re: Standardizing tree-sitter fontification features Date: Fri, 25 Nov 2022 19:03:46 +0000 Message-ID: References: <88CEDB6E-AD74-4B18-81DE-F6A3436B5851@gmail.com> Mime-Version: 1.0 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="33767"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 20:04:49 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 1oye0G-0008aE-RN for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 20:04:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oydzb-0005yd-MB; Fri, 25 Nov 2022 14:04:07 -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 1oydzY-0005yN-VD for emacs-devel@gnu.org; Fri, 25 Nov 2022 14:04:04 -0500 Original-Received: from mail-4018.proton.ch ([185.70.40.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oydzV-0006q4-Kx for emacs-devel@gnu.org; Fri, 25 Nov 2022 14:04:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1669403037; x=1669662237; bh=JaDN5aC3TnXDYgLL0SuEnxkGor94b2fw6gkyfk8pSro=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=fAVLd5dvmsZrnyw7Uo0aP/ZJCaAVha29VLRiBNOazlC3rrVj6ejQrPXYQdDaHzyQ4 kKpD1Bb69vnvgQ7C6QFZC/dBvg+T0DdBoLjxzDR0EHanwQeOAXpJpH0DxpDyCTjnDS q/4z5sq0X0eRNfTXQPn8uOS+2BO7kOlw/7VAfMQTiNvRR0A66mNtffHyJLQY08GTxY YGHNkaGAHeM/GMT2TXvbY+MvpcvBEckQd7PNUd2vpPCNgLiQbE16cD78Lc/lspJw1d FZYxubS2KMQ7qFkK4eznKANaXtCYLcfEVE/HPCsXk+mvOaJDue05nIzhAZNKru7U8B gnGjjCKClPRFA== In-Reply-To: <88CEDB6E-AD74-4B18-81DE-F6A3436B5851@gmail.com> Feedback-ID: 44397038:user:proton Received-SPF: pass client-ip=185.70.40.18; envelope-from=dev@rjt.dev; helo=mail-4018.proton.ch 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, SPF_HELO_PASS=-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:300508 Archived-At: On Friday, November 25th, 2022 at 01:15, Yuan Fu wrote: >=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 woul= d 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, a= nd for a reason. Personally I only want to highlight identifiers in definit= ion and assignment, not every occurrence of them. Since so much of a progra= m consists of variable and function identifiers, highlighting all of them l= ooks almost like highlighting everything. I just want some visual cues on t= he program structure, not programming in skittles :-) Fair enough. In that case, are we going to end up with duplication in the v= ariable and function features? So long as I can program in skittles, I am h= appy :). >=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 togethe= r? > 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). I think we should keep them all separate. =20 > > - (maybe) literal instead of number? That way there is a group for char= s too (and any other literals if there are any?). Or a char feature in addi= tion to the existing number one. I'm undecided... >=20 >=20 > Literal seems to encompass numbers, strings, chars, and constants. So I d= on=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. > > 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 mys= elf 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? Di= d you use the sort-word package on EmacsWiki? >=20 > Yuan Manually ;) (except for the keyword and such lists, those I use the built-i= n sort-lines on). I really like saying the alphabet over and over.