From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Thu, 29 Dec 2022 13:32:02 -0500 Message-ID: References: <83y1qt11xq.fsf@gnu.org> <9eb013da-d0fc-8e17-c6e3-1e8f913aebfa@yandex.ru> <83pmc50xxc.fsf@gnu.org> <71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru> <83h6xg29z3.fsf@gnu.org> <838ris22n4.fsf@gnu.org> <8335901zz3.fsf@gnu.org> <87cz84y5le.fsf@posteo.net> <3F91FDEA-881A-49DB-BB52-5A0D81C004CE@gmail.com> <87k02aihrz.fsf@posteo.net> <86ce08480352653995b8@heytings.org> <87r0wigqnb.fsf@posteo.net> <86ce08480372e6e5db04@heytings.org> <87358ygmm4.fsf@posteo.net> <86ce084803fb642d8fae@heytings.org> <87r0wif59x.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15392"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gregory Heytings , Yuan Fu , Eli Zaretskii , Dmitry Gutov , Tim Cross , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 29 20:16:53 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 1pAyOa-0003jk-3o for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Dec 2022 20:16:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAxhQ-00051U-Ig; Thu, 29 Dec 2022 13:32:16 -0500 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 1pAxhM-00050h-Ny for emacs-devel@gnu.org; Thu, 29 Dec 2022 13:32:13 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAxhK-0002rp-PR; Thu, 29 Dec 2022 13:32:12 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 987ED10012D; Thu, 29 Dec 2022 13:32:05 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 13D3C1000DC; Thu, 29 Dec 2022 13:32:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1672338724; bh=6otjT71QWSLfr+H07ex84LxQbePg9D+uP0afneWxwbc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hU3S/SxIeKHzxDU/dH2RKSp4UAV6v1ztnxiFsEE7EwbOfZEroiD0do49uTHgbMmcd M2lcjIEP8IXhYp8tCTHHIN/LsKbNQAQ8Ekslls8Xmlp//YbtQ4uKFdicJoReP9wM0e z8QM+etMOtufWE3ep/zwMTNH4F6u0Rkqlv/G8nq4N2hjzdymOcOt5iWYXEeSHAK/Hm u7FhbqitrCuBvxmz3VrN9FSRaCWvBQHbU0PVGhhI9C85gm30OHLSQtfk2E9A4b9BIR VzH0zpq2DtcGEYOq7OsVW4xJ+L0prPg1npQtWphDYxhFYAETW1dQNdh1Yl8uL9gbPy J3NDzLj0MpX6Q== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C1B5B120931; Thu, 29 Dec 2022 13:32:03 -0500 (EST) In-Reply-To: <87r0wif59x.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 29 Dec 2022 18:12:26 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca 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, RCVD_IN_DNSWL_MED=-2.3, 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:302059 Archived-At: > My main worry with these changes, along with the popularity of LSP is > that while they are technological improvements, they all happen at the > deterioration of Emacs' introspectability, increasing the effort it > takes for the user to make changes. IIUC you can't reload a .el file or > just a singular expression if you want to change how completion via > Eglot or how imenu works via Tree Sitter. A simple hack becomes a > weekend project. This is not an unconditional good. Agreed. Tree-sitter is actually not that bad in this respect: beside the fact that it requires additional tools to work on the grammar, "everything else" is under the control of ELisp: Tree-sitter only takes care of parsing and giving a parse tree without imposing any particular way to use this information. So the only thing on which we need to work is making it easier for our users to hack on the source grammar. That means helping them fetch that grammar and helping them figure out which commands to run to generate the `.c` file from it. Maybe we could also try and write code that jumps from a particular position in a buffer to the BNF rule of the corresponding Tree-sitter node. LSP is much more problematic because the protocol is structured in a way that gives a lot of decision making on the server side and the Emacs side is somewhat limited to supporting or not supporting a particular feature. I think this is a large part of the reason why some languages see a proliferation of different LSP servers: what should ideally be configured on the editor side is instead "configured" on the server side by choosing which server you use :-( Stefan