From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Standardizing tree-sitter fontification features Date: Sat, 26 Nov 2022 06:03:50 -0800 Message-ID: <86bkothkxl.fsf@stephe-leake.org> References: 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="39353"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 26 15:04:56 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 1oyvnb-0009zp-AE for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Nov 2022 15:04:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyvn3-0003N2-NP; Sat, 26 Nov 2022 09:04:21 -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 1oyvmz-0003Li-2G for emacs-devel@gnu.org; Sat, 26 Nov 2022 09:04:17 -0500 Original-Received: from outbound-ss-820.bluehost.com ([69.89.24.241]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyvmw-0005Sp-HS for emacs-devel@gnu.org; Sat, 26 Nov 2022 09:04:16 -0500 Original-Received: from cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway2.mail.pro1.eigbox.com (Postfix) with ESMTP id E0857100492D3 for ; Sat, 26 Nov 2022 14:03:50 +0000 (UTC) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with ESMTP id yvmYoicszgvoxyvmYognDq; Sat, 26 Nov 2022 14:03:50 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=SLmH6MjH c=1 sm=1 tr=0 ts=63821cc6 a=dWLzHQi6WpdymmZIwiVdBw==:117 a=Fln8i1WyhtedwaIJAdHvmw==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=9xFQ1JgjjksA:10:nop_rcvd_month_year a=vvvmwbhNdt4A:10:endurance_base64_authed_username_1 a=pGLkceISAAAA:8 a=rsNoVOHdXL74B8-YQuAA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MEbNcUlm52F/n/bTbEnMJZiW15V81U4HV+itVic+Qvo=; b=QC/aIicQgfRE7Han44VwZdUj6B +RyLoGPKU8JiFo2p/6HL5iKUgfry6rFTudV+EmgDKizH9qeRsXN+43zSuOBEE5vd+bKmKV/7k1+Ps Hwf62dTF63Qv9YxcjcY6QJLR5fUFnvJvl0nzwhSDpJRaC8ZXOs0UvszlV+meO8Gx/+dld0KLd3zMt 5pV50UPsR/7lt62eXEhmQSzPXmZe/hGixKP1D9HqQzt3zEw0j8upuFn9R34i90/hJeWzrFH24rv/g TPC6aHWKTkHm2T4vHecwHDSDXRxniowlX3rwczZALmofa+SlPuZYAk3Pp/3nkerkxkpR0Y3FjzKDE 3QWzA5LQ==; Original-Received: from 135-180-197-170.fiber.dynamic.sonic.net ([135.180.197.170]:53608 helo=DESKTOP-G20DCG1) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oyvmY-000YZh-9Q; Sat, 26 Nov 2022 07:03:50 -0700 In-Reply-To: (Yuan Fu's message of "Thu, 24 Nov 2022 14:16:02 -0800") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 135.180.197.170 X-Source-L: No X-Exim-ID: 1oyvmY-000YZh-9Q X-Source-Sender: 135-180-197-170.fiber.dynamic.sonic.net (DESKTOP-G20DCG1) [135.180.197.170]:53608 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 2 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: pass client-ip=69.89.24.241; envelope-from=stephen_leake@stephe-leake.org; helo=outbound-ss-820.bluehost.com X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:300566 Archived-At: Yuan Fu writes: > For tree-sitter-based major modes, fontification rules are categorized > into =E2=80=9Cfeatures=E2=80=9D, which can be individually turned on/off.= I think it > would be good to have a standardized list of common features and their > precise meaning defined. We=E2=80=99ve been working on these fontification > rules for some time and arrived at a reasonable baseline, and now it=E2= =80=99s > a good time to discuss and bless it, I think. > > Right now we have: > > Basic tokens: > > delimiter ,.; > operator =3D !=3D || > bracket []{}() > > constant true, false, null > number > keyword > comment > string > string-interpolation f"text {variable}" > escape-sequence "\n\t\\" > function every function identifier > variable every variable identifier > type every type identifier > property a.b <--- highlight b namespace would be useful; in some languages, like C++, the syntax namespace::namespace::object.member makes it clear which identifiers are namespaces. In others, like Ada the syntax is namespace.namespace.object.member, so it's not clear. --=20 -- Stephe