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.bugs Subject: bug#55428: [feature/tree-sitter] Simplify the parser creation API Date: Sun, 15 May 2022 17:26:11 +0300 Message-ID: <83h75qkh31.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1823"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55428@debbugs.gnu.org To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 15 16:27:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nqFDC-0000Je-4N for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 May 2022 16:27:10 +0200 Original-Received: from localhost ([::1]:58234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqFDA-0000ju-TN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 May 2022 10:27:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqFD4-0000jW-39 for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 10:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqFD3-0005dQ-QF for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 10:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqFD3-0006Yn-N4 for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 10:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 May 2022 14:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55428 X-GNU-PR-Package: emacs Original-Received: via spool by 55428-submit@debbugs.gnu.org id=B55428.165262479125177 (code B ref 55428); Sun, 15 May 2022 14:27:01 +0000 Original-Received: (at 55428) by debbugs.gnu.org; 15 May 2022 14:26:31 +0000 Original-Received: from localhost ([127.0.0.1]:50375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqFCZ-0006Y1-ER for submit@debbugs.gnu.org; Sun, 15 May 2022 10:26:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqFCX-0006Xl-Qm for 55428@debbugs.gnu.org; Sun, 15 May 2022 10:26:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqFCS-0005bp-JQ; Sun, 15 May 2022 10:26:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=UKy7eeV+mBNp0+diUdSIdMYWMk3/Nvflm98w/C9CAog=; b=GXQ63VI/S71jaku+J6yn e4IMPsqCVujLcaFJucT4YPzy5J6y83KF24HLvfiJ7Q4tQFjb9UpCAzBJak5U4zRu6z6wknsSNqFfP NxtIxDn2c890rdGFO/wiwvDxS+q/E7KLfkuJhZeSp1VzUSmr3mxF37CdWaWdGy/BjLf5TmI4RxEf7 At1vxTFugxeAcyPGBj5EkyatJ+fcNGpnERybZ1YUOb8TzYqpuS5vUAlFeZCCPpmw4DsOm8qBtHJE+ M4pE1BWluVztnz9K48yQhuRDpkDiA15dDPUaTZq/JfXPWY6JmJlAChjlvli2Q+vAnS5ho5uP/5qez ZYU/JdSE9vf0JQ==; Original-Received: from [87.69.77.57] (port=3882 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 1nqFCR-0005kg-WC; Sun, 15 May 2022 10:26:24 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232316 Archived-At: > Date: Sun, 15 May 2022 16:15:57 +0200 > From: Daniel Martín via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Currently, there are three functions to create a tree-sitter parser: > > - treesit-get-parser-create > - treesit-get-parser > - treesit-parser-create > > I think this set of similarly named functions can be reduced, so that > developers don't need to remember a lot of APIs. How I understand the > problem of creating a tree-sitter parser is that we need three things > from the developer: > > - A programming language (a symbol). > - A buffer (optional, default to the current buffer). > - Whether to create or reuse an existing parser for that language. > > I think it would be simpler to have just one parser creation API like > > (treesit-make-parser LANGUAGE &optional BUFFER ALWAYS-NEW) I suggest that discussions about the API be held on emacs-devel, not hear. That way, more people will see them and could decide whether to participate. Thanks.