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: Tree-sitter integration on feature/tree-sitter Date: Sat, 18 Jun 2022 13:11:50 -0700 Message-ID: <1CEC92F7-3CB9-48DA-887C-43CD4C58E406@gmail.com> References: <5bada349-2f43-4325-b696-70918584cd3d@email.android.com> <83mtfsuluo.fsf@gnu.org> <87sfpjhm33.fsf@thornhill.no> <83a6brufe5.fsf@gnu.org> <87pmkmhp8i.fsf@thornhill.no> <83v8ueuc7i.fsf@gnu.org> <73DE25BA-5EEF-4497-8F98-8C5F20853A61@gmail.com> <87v8uewfuq.fsf@thornhill.no> <87mtfkbt9n.fsf@thornhill.no> <1179E1EC-90EF-4989-BE1D-115498F77F60@gmail.com> <87k0ajygry.fsf@thornhill.no> <6EF70929-5759-4F1A-B878-0C1660FB6831@gmail.com> <87leuy5z46.fsf@thornhill.no> <2E68780C-9923-411E-A5DF-B1A54E2EC38B@gmail.com> <83k09fq0am.fsf@gnu.org> <38C272F6-828C-4478-9D90-326AF14D0C94@gmail.com> <87h74j2lin.fsf@gmail.com> <4C257709-0E3E-46A7-8CEB-569001EEE31D@gmail.com> <87edzm2vk8.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) 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="33890"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Theodor Thornhill , Stefan Monnier , Daniel Colascione , emacs-devel@gnu.org To: Yoav Marco Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 18 22:13:13 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 1o2eoi-0008dD-Ox for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 22:13:12 +0200 Original-Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2eoh-00022t-5T for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 16:13:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2enT-0001LS-S7 for emacs-devel@gnu.org; Sat, 18 Jun 2022 16:11:55 -0400 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:36603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2enR-0004WH-Vp; Sat, 18 Jun 2022 16:11:55 -0400 Original-Received: by mail-pl1-x634.google.com with SMTP id u18so6545981plb.3; Sat, 18 Jun 2022 13:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qdu93r5BCKOVNzA828aqw2imM8/JR+AlJ2QCfb/uIGY=; b=RM6EeREuaEDCe0jzRIx0Li82kbeNz63mRiLpHJrJ/cnVgDm/ORzGj+GMbmyzbYwMUU 3RZRwa/1wKWO+OXrswnJMQsuFWhLa0nMtGiq759qYeGyeLtu/ZKaxv74TcA58lb9/pxi 6nnCqmPJvdZOeDABZ4DYFCiaIi3eDb+S8Jk+N1EwfBHUwQOnLdMKEi/HAGdXr6uXYWpg WZmNrpIailmz7zkbPR94kOw3ONW0Kv8UGJpSMrrtA5u8s8OCsIytsp04tbLV1dxzFm+s haHLtTqlZqE8VhEefYMH+RrMG3IQWgvGchsXdb5+AvbH8G5QvQzMx/Q0wmQj9dFOhfue Dy/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qdu93r5BCKOVNzA828aqw2imM8/JR+AlJ2QCfb/uIGY=; b=6ia1IrpDXHazCPIpcqP5sjbow6NcRYqZRMqVPzKGBA4x7hwVZmc6EWpKhZDyrIWRol bPhGVGk3st6TO/EQYhl5fK7PMLkhoFQxdhLZWRP79J3Jp2gSAsQuOAro+MFRfKgLz6sR xC09avvesWwvLtvjlocoHrAGA2a7SCmsjHfWRGe7QF5rpZQ7mSqwtd2FzZwM0h7OwSJV lPF65xdts0m7bdM518oNZ7Q/I6QX42MJACMalhjHZIXyyRKaTvgPNHstQVFzVwX95rca 5BtP4beb6orK+gtsj9z4OvdFK8fMyKBsG5uD8e6RxhvCmCD5emiSoRqgL4IbJP4ppUD0 5XEg== X-Gm-Message-State: AJIora8LVwShVn7kezGQXL27wZVPmBi/df0+Lx5RSUnkCUFk3oWD8Ncu 6zzF0UvfHQuC1MOAhd/889FyR9AZ7ME= X-Google-Smtp-Source: AGRyM1uALf/RO5y+dd6WqMY99IfL6xMYyKPw1TV2PZsvp3BeyRAHh6p61Rns+LGRyZhtpx3YAPz06w== X-Received: by 2002:a17:90a:fd17:b0:1ec:92c0:575 with SMTP id cv23-20020a17090afd1700b001ec92c00575mr2228793pjb.55.1655583111788; Sat, 18 Jun 2022 13:11:51 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:99d9:ea9d:a995:fcb4]) by smtp.gmail.com with ESMTPSA id g12-20020a62f94c000000b0050dc762816asm5969176pfm.68.2022.06.18.13.11.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jun 2022 13:11:51 -0700 (PDT) In-Reply-To: <87edzm2vk8.fsf@gmail.com> X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=casouri@gmail.com; helo=mail-pl1-x634.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, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:291385 Archived-At: > On Jun 18, 2022, at 1:15 AM, Yoav Marco wrote: >=20 > Yuan Fu writes: >>> That reminds me -- Yuan, have you seen my PR to tree-sitter-langs, = Hacky >>> support for treesit in Emacs core [2]? >>>=20 >>> It uses tree-sitter-langs' groundwork for fetching grammars and >>> packaging highlighting queries, but uses treesit instead of the >>> tree-sitter dynamic module. >>>=20 >>> Enabling highlighting is just M-x treesit-langs-hl-mode in = major-modes >>> that tree-sitter-langs supports. >>>=20 >>> [2]: https://github.com/emacs-tree-sitter/tree-sitter-langs/pull/99 >>=20 >> Ah yes, I=E2=80=99ve seen it. I think the part that automatically = downloads and builds >> language definitions is very useful. It cannot be in Emacs core = because we >> cannot distribute language definitions, but it could be a very useful = ELPA or >> MELPA package. >=20 > Yeah, I agree. tree-sitter-langs makes it very easy to use > elisp-tree-sitter and now also the newer treesit. >=20 >> The part that automatically generate highlighting is also useful, >> but I=E2=80=99m not sure how would we use it. >=20 > A little neatpick -- it doesn't really 'generate', just converts > tree-sitter-langs' hand-crafted highlights.scm query files to be = usable > by treesit too. >=20 >> We probably don=E2=80=99t want to add a tree-sitterify-mode that just = enables >> tree-sitter highlight in a mode=E2=80=94I prefer that we change each = major >> mode to use tree-sitter features. >=20 > I agree, though since grammars aren't packaged with Emacs, major-modes > that *are* packaged with Emacs would need to only use treesit when the > grammars are avaliable. Or do we expect grammars to be a dependency = when > users are installing Emacs? No, we don=E2=80=99t distribute language definitions, built-in = major-modes should support both tree-sitter and non-tree-sitter. >=20 >> Also I think it makes more sense if you just fork it rather than = making a PR. >=20 > Yeah, I don't really expect it to be merged. >=20 > My reason for the PR is for it to be more of a talking point about > collaboration between treesit and tree-sitter-langs. I used > elisp-tree-sitter before trying the feature/tree-sitter branch, and I > really like the richness of its highlighting (which comes from the > highlights.scm files). Do you already have the highlighting working for treesit? If so, maybe = you can packages it in a separate package and publish it, it would be a = nice demonstration of treesit features. Yuan=