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: Sat, 26 Nov 2022 03:35:23 +0000 Message-ID: References: <88CEDB6E-AD74-4B18-81DE-F6A3436B5851@gmail.com> <46533EA2-1CC5-40E8-8726-94A0BAD0C919@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="25991"; 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 Sat Nov 26 04:36:40 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 1oylzc-0006Zq-E1 for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Nov 2022 04:36:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oylyl-0005Pq-RC; Fri, 25 Nov 2022 22:35:47 -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 1oylyi-0005Od-46 for emacs-devel@gnu.org; Fri, 25 Nov 2022 22:35:45 -0500 Original-Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oylye-0006ln-DS for emacs-devel@gnu.org; Fri, 25 Nov 2022 22:35:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1669433730; x=1669692930; bh=KnsooKnUJjMMi4t1WyAsOlgmevnXF1F9+j+z6KOu78A=; 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=eEhbkSKKyIhHTZUoCTWz7ZMg7FQG6GSsYR8Pji6qunKfzbva4ykJswsQeLvJ9vKxk EGuLlb26CW8xSzsAhwztBaRjV20/PbLezcRd+kbA6nzLc/Mlb6DiuopNRTmcqWV/tz 9RQ/8O702gkknUZ7ZDcfis2pl3JxVsDrtPbKyFQ/jYlkZcFRooyRtPciERCJXfZ5Wl BgEOBOSDk2wixjnh8s4K8ttldvX13mevBm7GXDddKKYbTSSTnVYQbjwOn5QGLoLtAV sSZLY7dFPcfhp5jBDsdyYRSfXdKAUyw2ojgC+DbUZ11RwDrja5D/9h52lbK5NJWUc7 85qrqcEaXgrDw== In-Reply-To: <46533EA2-1CC5-40E8-8726-94A0BAD0C919@gmail.com> Feedback-ID: 44397038:user:proton Received-SPF: pass client-ip=185.70.43.23; envelope-from=dev@rjt.dev; helo=mail-4323.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, RCVD_IN_MSPIKE_H2=-0.001, 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:300546 Archived-At: On Friday, November 25th, 2022 at 15:55, Yuan Fu wrote: > > > On Nov 25, 2022, at 11:03 AM, Randy Taylor dev@rjt.dev wrote: > > > > On Friday, November 25th, 2022 at 01:15, Yuan Fu casouri@gmail.com wrot= e: > > > > > > On Nov 24, 2022, at 5:13 PM, Randy Taylor dev@rjt.dev wrote: > > > > > > > I wonder if assignment and definition are really worth having (and = would prefer to do without them), since they should be covered by the varia= ble, function, type and property features. > > > > > > They are definitely useful. They are the things we currently highligh= t, and for a reason. Personally I only want to highlight identifiers in def= inition and assignment, not every occurrence of them. Since so much of a pr= ogram consists of variable and function identifiers, highlighting all of th= em looks almost like highlighting everything. I just want some visual cues = on the program structure, not programming in skittles :-) > > > > Fair enough. In that case, are we going to end up with duplication in t= he 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 the= m, or just left it on: the face would be the same, the difference is only o= ne which ones to highlight. > I meant duplication in writing the queries. Variable and function queries w= ould already cover most or all of what's in assignment and definition. > > > > > - (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... > > > > > > 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. > > > > 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) > 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 t= hing for character (they even differentiate between conditionals and loops!= !!). emacs-tree-sitter isn't consistent. I think it makes sense to include it in string though, just so long as it d= oesn't have the same face. Perhaps the constant face is best for it?