From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Update on tree-sitter structure navigation Date: Fri, 8 Sep 2023 23:52:48 +0300 Message-ID: References: <5E7F2A94-4377-45C0-8541-7F59F3B54BA1@gmail.com> <8a5b3b3e-f091-3f38-09d4-c4e26bec97f9@yandex.ru> <83h6o5xj4f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24030"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: emacs-devel@gnu.org, danny@dfreeman.email, theo@thornhill.no, jostein@secure.kjonigsen.net, dev@rjt.dev, wkirschbaum@gmail.com, pedz@easesoftware.com To: Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 08 22:53:56 2023 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 1qeiUG-000648-QD for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Sep 2023 22:53:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeiTX-0005qs-Qa; Fri, 08 Sep 2023 16:53:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeiTV-0005qg-FA for emacs-devel@gnu.org; Fri, 08 Sep 2023 16:53:09 -0400 Original-Received: from forward500c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d500]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeiTR-0006g2-U4; Fri, 08 Sep 2023 16:53:09 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bbac:0:640:58d8:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id 7245B5EB75; Fri, 8 Sep 2023 23:52:57 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id rqhVixDDfSw0-pnr2XUzX; Fri, 08 Sep 2023 23:52:56 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1694206376; bh=yCOvLkVF7JOwHJKbEJU3ZFO4tBfoo6GCCR9Mf0FZLqs=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=T0g9J4HSWiBNTk6pNPpso8madnp2v+UTLMuKOrOX+HVmJ/q4Ho4wdAAvckVPXCEX/ oP+LwXeqYGxRsd8HCtTS2Fq38Ez1hLNEk6+ufmtkxy0qppQh6J3f/BvOBYIDTmJzEl a70qVbb1c3KmD7VNT6TosigaC2uY/A7MI+V2t2ig= Authentication-Results: mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 27A8F27C0064; Fri, 8 Sep 2023 16:52:52 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 08 Sep 2023 16:52:53 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehjedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpefgjefhudffgedvveethffgteetgfeflefgleffheeghefhieduheefvdff geetgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Sep 2023 16:52:50 -0400 (EDT) Content-Language: en-US In-Reply-To: <83h6o5xj4f.fsf@gnu.org> Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d500; envelope-from=dgutov@yandex.ru; helo=forward500c.mail.yandex.net X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 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, NICE_REPLY_A=-1.473, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310368 Archived-At: On 08/09/2023 09:40, Eli Zaretskii wrote: >> From: Yuan Fu >> Date: Thu, 7 Sep 2023 18:04:02 -0700 >> Cc: emacs-devel, Danny Freeman, >> Theodor Thornhill, >> Jostein Kjønigsen, >> Randy Taylor, Wilhelm Kirschbaum, >> Perry Smith >> >>> I don't have a better idea than basically copying NeoVim and others: to maintain the urls to parser repositories and the ref of the latest known good revision, for the current version of the major mode. That info could be filled in by major modes themselves, e.g. in an autoload block (similarly to how auto-mode-alist is appended to). >> That’ll probably be ideal for third-party modes. But knowing Eli, I don’t think builtin major modes can do that. > FTR, I have nothing against this technique, I just said that it will > need volunteers to assume this non-trivial job for each major mode, > and therefore I personally don't believe this to be a reliable > solution in practice. But if volunteers step forward to do this, I > don't object. I don't see a way around it, if the grammars continue to add breaking changes. We already have volunteers: when somebody works on a ts mode (adds a new feature or verifies that the current font-lock and indentation work fine), might as well put in the last-known-good commit hash. Or update it, if needed (e.g. the new feature requires that). Adding versions ranges if/when proper versions arrive might require more foresight, but the alternative seems to be "unsupporting" distro-packaged grammars. What I'm saying is in this case not doing this job well (e.g. updating the commit hashes and font-lock/indent rules very rarely) might still be better than not doing it at all.