From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Call for volunteers: add tree-sitter support to major modes Date: Sun, 09 Oct 2022 12:03:48 +0300 Message-ID: <83czb1jrm3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24365"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 09 11:05:49 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 1ohSFp-00069H-HJ for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Oct 2022 11:05:49 +0200 Original-Received: from localhost ([::1]:44740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohSFo-0004hS-7v for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Oct 2022 05:05:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohSDu-0003np-Ce for emacs-devel@gnu.org; Sun, 09 Oct 2022 05:03:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohSDq-0004km-Sz for emacs-devel@gnu.org; Sun, 09 Oct 2022 05:03:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=pRGKwGoicwVbl8W1VF9bI382n27bvXHXUjCYUisZ9oo=; b=IDavYdY3FkgGD8 6H62q7eiRzSsAaevOjXm/g6GK4/lGLUkqMJCVE2ptB0oIOqkK6zFeB4oUJO34f29kXQeOyNBbU+hL uVPaE2M5lbJnziZ69WRHEAwKvK304kABHNm/JRBKHddfuf8GgUxaMo9DEnzcY05qpkHd9R5M3M1ZI tdzSQFwJ75rBh42at9aVMcixnVAApPd0DBMP4AWfn9RGHdXZYQmU8jP1f5j4gB0RT9VLnXzhWyJpZ f8MzLiiy47Nw3MPUpXnWrlWV99NM8wiAI6KVrxaKk1lxwmyGlVGYJiCDH7cSeOXYS8PEHGA7h8UnX 2CYzZsqnDxCE87ismLQQ==; Original-Received: from [87.69.77.57] (port=3591 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohSDn-0007za-JR for emacs-devel@gnu.org; Sun, 09 Oct 2022 05:03:46 -0400 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:297247 Archived-At: The Emacs 29 release branch is planned to be cut in about 1.5 months, and we want tree-sitter support to be in Emacs 29. The Emacs Git repository has a feature branch that integrates tree-sitter with Emacs. That branch is being prepared for landing on master. However, currently there's only one major-mode which can use tree-sitter support on the branch: Python mode. We need to add tree-sitter integration to more major modes, so that Emacs 29 could have reasonably useful tree-sitter support options in at least the popular major modes. This is a call for volunteers to work on adding tree-sitter support to major modes beyond Python, and on improving the existing support in Python mode. 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 We probably won't have all of them by Emacs 29, but we hope to have at least some. So if you are interested in enhancing your favorite major-mode with tree-sitter support, and by doing that making Emacs 29 much better, please checkout the feature/tree-sitter branch, and start working on some mode(s). Tree-sitter support for a major-mode should include enhancement of one or more of the following Emacs features: - font-lock - indentation - navigation (beginning-of-defun-function etc.) - imenu - which-func - thing-at-point We think that font-lock is the absolute minimum, followed by indentation. To help with this effort, Yuan Fu, who did most of the development on this feature branch, wrote a document with guidance notes which aim to help you implement tree-sitter support for the above features. You will find that document and some other helpful documentation in the admin/notes/tree-sitter directory and its subdirectories on the branch. That directory also includes scripts for easy compilation of tree-sitter language modules (which you will need to download from the tree-sitter site). We hope that the existing support for Python can serve as working example of how to add tree-sitter support for other major modes, and together with the guidance document it will allow you to add support for more modes with minimum effort. Don't hesitate to ask questions if something is unclear or you need more advice. We hope volunteers will step forward in time to make tree-sitter integration in Emacs 29 functional and useful. To avoid waste of effort, please announce here on which major mode(s) you decided to work. Thanks in advance.