From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Call for volunteers: add tree-sitter support to major modes Date: Mon, 10 Oct 2022 19:44:40 +0000 Message-ID: References: <83czb1jrm3.fsf@gnu.org> <878rlo7on0.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5586"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill , Eli Zaretskii , emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 10 22:13:03 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 1ohz94-0001Gc-VA for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 22:13:02 +0200 Original-Received: from localhost ([::1]:52154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohz93-0005a5-Ko for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 16:13:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohyhw-0003VC-1b for emacs-devel@gnu.org; Mon, 10 Oct 2022 15:45:00 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:19734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohyhs-0000Pr-8G for emacs-devel@gnu.org; Mon, 10 Oct 2022 15:44:58 -0400 Original-Received: (qmail 34429 invoked by uid 3782); 10 Oct 2022 21:44:41 +0200 Original-Received: from acm.muc.de (p4fe15ba6.dip0.t-ipconnect.de [79.225.91.166]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 10 Oct 2022 21:44:40 +0200 Original-Received: (qmail 559 invoked by uid 1000); 10 Oct 2022 19:44:40 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:297399 Archived-At: Hello, Yuan. On Sun, Oct 09, 2022 at 17:01:45 -0700, Yuan Fu wrote: > > On Oct 9, 2022, at 1:01 PM, Theodor Thornhill wrote: > > Eli Zaretskii writes: > >> Some of the popular major modes for which we would like to see > >> tree-sitter support in Emacs 29 are: > >> c-mode > >> c++-mode > >> emacs-lisp-mode > >> js-mode > >> js-json-mode > >> ruby-mode > >> shell-script-mode > > I'd like to add in Java support here as well. But since java is part > > of cc-mode.el, maybe it'd be best if it got its own mode, say > > java-treesitter-mode.el, so that we don't add a dependency into > > cc-mode? If you agree, I can create such a major-mode as well. > I think we can use the same major mode, just skip the cc-mode > initialization and only enable tree-sitter stuff if > java-use-tree-sitter is true. But I want to know Alan’s thought on > this. I included him in CC. Thanks! At the moment, I'm still trying to get a handle on what tree-sitter is and can do. The idea of including lots of tree-sitter modes in Emacs 29 came up very suddenly over the weekend. > > Also, how should we mandate what modes get the new tree-sitter > > support? It is pretty fast to add new modes, and adding support for > > languages not already supported in core, such as say, golang, should > > be very feasible. But maybe that is something that should live in > > elpa? > If you want to add tree-sitter support for some built-in mode, go for > it. But I would focus on the modes we already have in core. For modes > like golang where there is a widely used mode out there (in this case > on ELPA), we should either ask to move it into core first, or ask the > author to maybe add tree-sitter support, or submit a patch to him/her, > rather than creating a duplicate go-mode in core just for the sake of > tree-sitter. > Yuan -- Alan Mackenzie (Nuremberg, Germany).