From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sat, 07 May 2022 21:00:33 +0200 Message-ID: <87mtftqib2.fsf@thornhill.no> References: <9E6D13F6-7E50-44EE-A357-C971A11A3636@gmail.com> <837d6xzpac.fsf@gnu.org> <7B1F29B4-045A-420E-8FD7-C7C72FF14DDC@gmail.com> <837d6xxjpv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24824"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 07 21:01:57 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 1nnPgi-0006Cj-Lb for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 21:01:57 +0200 Original-Received: from localhost ([::1]:52358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnPgh-0002Mn-4X for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 15:01:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnPfY-0001b0-GZ for emacs-devel@gnu.org; Sat, 07 May 2022 15:00:44 -0400 Original-Received: from out1.migadu.com ([2001:41d0:2:863f::]:30417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnPfU-0000cJ-O5; Sat, 07 May 2022 15:00:43 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1651950036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h1ucdQzKpwVdR3GmgSotC9IUy4aEjdpGMtylq+neeb0=; b=Ke58nozFXQ0bL5rny8YWP+TGDZ4R2OKVrvysasWpMKOVMJ80ln5pHdbeXYAoA0jqcUoet2 SGBZ+eV+3hPYbL5ODurkiZ/tQqft3Gzd04FH6Q6ub15bns2267CMNWpj5omJB33+SavZGk W6gPUBHfHpb4uX8yE3jYifjb9nUlhNB4wuiosGNCOlaHVjP96ypMRuPfRhOPTO0v0Rbgf9 63QpQllIKet7N+eYaHWi8EJw2L3NQvrCkV1f860KxnZNJZeC+7y06/7bGnA1e0LlftAMfO eavsHSJIw7n/QF0R2+z6iSEfJhSGuhSbm1ksC5Aq/H/g3wqVZIXWU2Xv91nbFQ== In-Reply-To: <837d6xxjpv.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: thornhill.no Received-SPF: pass client-ip=2001:41d0:2:863f::; envelope-from=theo@thornhill.no; helo=out1.migadu.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, 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:289426 Archived-At: > > Yes, thanks. > > However, I hoped that the font-lock and indentation are already > integrated with tree-sitter, and all that is needed for a given > major-mode to use it is to flip some variable. I didn't expect to > need a completely separate major mode for C sources, for example. Isn't that the case, though? You need to define the patterns to use, but apart from that, there's not much to it. I don't believe tree-sitter itself is opinionated on how saturated the font-locking should be. As for definining completely separate major modes, I personally think that's some of the point. All of CC Mode functionality can be replaced by the equivalent tree-sitter one. Whether or not that should be its own mode or behind some defcustom is up for discussion. > > It sounds like we are farther from the goal that I thought we were, > and some serious work is still ahead of us to get this integrated into > the existing major modes. There's some manual labor involved in supporting a language. Look at how neovim does it for an alternative: https://github.com/nvim-treesitter/nvim-treesitter This is a collection of queries and highlights, as well as some functionality to download the proper definitions. Theodor