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, 7 May 2022 11:27:11 -0700 Message-ID: <7B1F29B4-045A-420E-8FD7-C7C72FF14DDC@gmail.com> References: <9E6D13F6-7E50-44EE-A357-C971A11A3636@gmail.com> <837d6xzpac.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 07 20:28:15 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 1nnPA6-0007na-DP for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 20:28:14 +0200 Original-Received: from localhost ([::1]:42858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnPA5-0001n5-0F for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 14:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnP9A-00016y-Mj for emacs-devel@gnu.org; Sat, 07 May 2022 14:27:16 -0400 Original-Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:42761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnP99-00051P-7Z; Sat, 07 May 2022 14:27:16 -0400 Original-Received: by mail-pl1-x630.google.com with SMTP id d22so10312772plr.9; Sat, 07 May 2022 11:27:14 -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=E+8Zt6p0osoCBpGdHoWrdoxIACzn/m1EpMeinyuouAA=; b=Ii4g3kil/pZdVgbmbd2H6/3nYJV/tAObzh8YtbF2WR47PPUfpNu3NIdajYdbrbyZJA ZGLr4Ka0J5hTlRpgg/ddipZVDR9OU3Bp45ug7FFB5x3GdHFz3ZjgzP4ROW2Er3lBiXDv 1LsjtSbty3lTv0NRw3wZhqPRDxSs/O9X44jfk+EPegJMV2BQsDk/VIU5swZLQHl6kjNp DxwEzkMc6K4FNzOGD/0zKMkIN+7akyBF0fkyq3CO43eftTKdXb/tO/BUHDFGkHo9syWf bpF05Gj4Qdb9zXogi4SnlhOhP7IAz/3FFXmLDLRJK9Uc6++iXiRsRyQm7tsNqBLC9NvY ZTog== 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=E+8Zt6p0osoCBpGdHoWrdoxIACzn/m1EpMeinyuouAA=; b=0k8rLyT9hNCR9mq1q0WgngniPTI7/0nKzEkF9D04Vc+UaBaGW3q4wTGdoxG4i3rLqa G2oFo3fgbC89Q+TZl6jzJxVop8IBqoZHxf4fZ9ZYpyQLSiXPEQJNHZ91p18OgzMCrssG o86AZOiwaLU0T+Ti09efUIoznsGYwmLeC+he1S6BjDFLvJIuSsB657v0IYDAXNRMDX9G 44mzrKikOGTthNbPk/UA50u4HdCJWrQjyRbWp6zwVJ1Mo8xFtX8kJyiTx322lUSN/e3L vqhU7YuVRiojwacka1WsywKRPj1xKMpqIrhGEX5499xDnCCBFmeEaCbPguQfAiofi67C 8aHA== X-Gm-Message-State: AOAM533co2aD4AfFBiZaTWHmkJRUWc1WAAuUw1AKWLtlrPruPptpS3k5 PRlUbnvqUSNx0jMxw1xMs3qqtVr+3vQ= X-Google-Smtp-Source: ABdhPJyU/lYxPqHdFSAkAo3HVh/vQkho+hUgb4lM0hLFgO0bJ2udJx2wgZzD9D119t1sH+5OaMgzIg== X-Received: by 2002:a17:902:e5c8:b0:15e:c2e2:bff6 with SMTP id u8-20020a170902e5c800b0015ec2e2bff6mr9211860plf.74.1651948033195; Sat, 07 May 2022 11:27:13 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:148:e841:81b0:7360]) by smtp.gmail.com with ESMTPSA id j8-20020a170903024800b0015e8d4eb228sm3996016plh.114.2022.05.07.11.27.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 May 2022 11:27:12 -0700 (PDT) In-Reply-To: <837d6xzpac.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.80.82.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=casouri@gmail.com; helo=mail-pl1-x630.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:289423 Archived-At: >=20 >> - play with it >=20 > Would you please suggest how to "play with it"? What features to turn > on and how, what commands and displays to try, etc. Posting such > instructions should allow all of us get to testing this branch much > sooner and easier. Some suggestions on top of my head: - Load the attached treesit-demo.el which contains a very basic C major = mode, ts-c-mode, that gives you some font-locking and indentation using = tree-sitter features. - Get a C file, change its extension to .tsc, and open it - The major mode should be ts-c-mode, and it should have some basic = fontification. - Type M-x treesit-show-buffer-tree RET to see the AST of the C file, = probably want to use this on a smaller C file. - Type M-x treesit-inspect-mode RET to display the AST of the node at = point in the mode-line, see more explanation in its doctoring. - Set treesit--indent-verbose to t, and try to indent some lines, and = see which indentation rule is matched. Is this the sort of things you are looking for? Or you are thinking = about testing the functionalities of tree-sitter? For that I can think = of: - Putting language definitions in different places and see Emacs can = find them correctly (~/.emacs.d/tree-sitter, path in = treesit-extra-load-path, LD_LOAD_PATH, etc) - Running tests in tests/src/treesit-tests.el - Use narrow and widen and see if everything works - etc Yuan=