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.bugs Subject: bug#59693: 29.0.50; treesitter in base buffer doesn't respond to modifications in indirect buffer correctly Date: Wed, 7 Dec 2022 15:13:19 -0800 Message-ID: <77899171-04F5-4BB2-BE26-4C999DAB0CA0@gmail.com> References: <87r0xlbjg6.fsf@miha-pc> <5F7AE71F-0327-409E-BCE9-310E1980C17A@gmail.com> <8335a0lept.fsf@gnu.org> <22B4F037-2979-4C65-8917-26D17CFBED0A@gnu.org> <83a64197ny.fsf@gnu.org> <0973FBCA-DFBE-4FF7-9052-2B60D2FC81DC@gmail.com> <83tu287ml3.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_33EA85EC-285A-4797-BC72-7219836DFFD9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30071"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59693@debbugs.gnu.org, Stefan Monnier , miha@kamnitnik.top To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 00:14:43 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 1p33cg-0007cV-VV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 00:14:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p33c3-0006eo-Ok; Wed, 07 Dec 2022 18:14:03 -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 1p33c2-0006cY-4E for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 18:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p33c1-0003dg-RI for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 18:14:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p33c1-0004QR-Mx for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 18:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Dec 2022 23:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59693 X-GNU-PR-Package: emacs Original-Received: via spool by 59693-submit@debbugs.gnu.org id=B59693.167045482716996 (code B ref 59693); Wed, 07 Dec 2022 23:14:01 +0000 Original-Received: (at 59693) by debbugs.gnu.org; 7 Dec 2022 23:13:47 +0000 Original-Received: from localhost ([127.0.0.1]:52750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p33bj-0004Q3-C2 for submit@debbugs.gnu.org; Wed, 07 Dec 2022 18:13:47 -0500 Original-Received: from mail-pj1-f42.google.com ([209.85.216.42]:42944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p33bT-0004Px-D1 for 59693@debbugs.gnu.org; Wed, 07 Dec 2022 18:13:42 -0500 Original-Received: by mail-pj1-f42.google.com with SMTP id k88-20020a17090a4ce100b00219d0b857bcso3214728pjh.1 for <59693@debbugs.gnu.org>; Wed, 07 Dec 2022 15:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=ZrSKpvRKQdXLbKPpY3bHragUPeDKirDPHdpGk7VEVBY=; b=cjAwA7LYRZQyH14sLTlTQ3+lLLjqT+Clc+8EiQfbMNtz4b4FQyxofl5nENf3KH1ERf y+d4j9GaIiLzl2kYdhR7Syq/W8ui3hixTUur5qQDhf7CrZIVWNNqHQpxp1g5M722oaru qNWNc4t8+N1D+zfcxwWo7W3sz1d1GmuINHkGvRU3Fn8oISthAp5Ls3Ho3A6RccZyB3xW MuaYuE1WTDFPJ2w2SUOAfstZiTQlhE+eW8QfXE1FOsBwrUxks0uhkPXpokjXZu+02V0p 1CZdAcjB5D/loE7ewgA3KYwUZhtpPK/rSZnVo6A5OQ3uyGppB/a5TogrWF97gzTjrEzl msHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZrSKpvRKQdXLbKPpY3bHragUPeDKirDPHdpGk7VEVBY=; b=h0bFHHLpfIS5Y6SVYntX8SCFSLSgABjI0K5Ok0BVt1xtJsC7QUmIaJoY+a8bIpYdYC pa2ZsNdkIEQS4V9jn0SGKeHX4cp0qxEUtVGsfkffVuoXzM9gzfoEvhVszu4k9nrcZfkb Otu9EfJ1LOR2sLZYc4e4ZJ8jvr3cX8Sdl1biMY7+Kv1Sw2rOnUqCyI0UD2MXS9OemIfP EnRt6BKiNt5KHgXqIi3sDyPLJNlGmMbNXJDHxfJ3eAotRm/sMJIxVp3jiDAQ5apPO91h a8W+lC0BihDtwJcitEmRf8rmvHxIwVQEnLnbGQ07fccIKlv+KXam19BQWZtqtpktQ9mD DQ9A== X-Gm-Message-State: ANoB5pkMBDcX3KiQZxOFqAcpGab9o774wvU6mUBfLxuCe64ckOkNf4FC jmzGruvB0XEfoay8H4mCQmA= X-Google-Smtp-Source: AA0mqf5/kOdEJI7xDNeADOsIZ/0n5b1mU/tp28KGp8/7qzW5YFVp2TdMqt4TpuiTSqTXoOs/SqlzKA== X-Received: by 2002:a17:902:e892:b0:188:f0da:c25c with SMTP id w18-20020a170902e89200b00188f0dac25cmr1783215plg.14.1670454801629; Wed, 07 Dec 2022 15:13:21 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id i20-20020a170902e49400b00168dadc7354sm15097806ple.78.2022.12.07.15.13.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2022 15:13:21 -0800 (PST) In-Reply-To: <83tu287ml3.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250225 Archived-At: --Apple-Mail=_33EA85EC-285A-4797-BC72-7219836DFFD9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 6, 2022, at 4:17 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Mon, 5 Dec 2022 18:15:07 -0800 >> Cc: Stefan Monnier , >> 59693@debbugs.gnu.org, >> miha@kamnitnik.top >>=20 >> 1. Only allow base buffer to have parsers, no change is needed for = insdel.c, treesit_record_change can find the base buffer and update its = parsers. We can ask indirect buffers to use their base buffer=E2=80=99s = parser. Unless the base buffer is narrowed, I think it will work fine.=20= >=20 > I think this is fine, but we need to document it. >=20 >> I remember that there were a discussion along the lines of = user-narrow vs low-level narrow, what was the outcome of that = discussion? >=20 > Nothing in particular, and I don't think it's relevant. If some mode = needs > to widen, it can. >=20 > Thanks. Here is a patch that does #1. Yuan --Apple-Mail=_33EA85EC-285A-4797-BC72-7219836DFFD9 Content-Disposition: attachment; filename=indirect.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="indirect.patch" Content-Transfer-Encoding: quoted-printable =46rom=2092f3fe1fe6cb021b24247b518fbe852592c0852c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Wed,=20= 7=20Dec=202022=2014:50:16=20-0800=0ASubject:=20[PATCH]=20Make=20indirect=20= buffers=20use=20tree-sitter=20parsers=20in=20their=20base=0A=20buffer=0A=0A= *=20src/treesit.c=20(treesit_record_change):=20Always=20use=20the=20base=20= buffer.=0A(Ftreesit_parser_create):=20Always=20use=20the=20base=20= buffer.=20=20Also=20change=20the=0Afor=20loop=20into=20FOR_EACH_TAIL=20= (stylistic=20change).=0A(Ftreesit_parser_list):=20Always=20use=20the=20= base=20buffer.=0A=0A*=20doc/lispref/parsing.texi=20(Using=20Parser):=20= Update=20manual.=0A*=20test/src/treesit-tests.el=20= (treesit-indirect-buffer):=20New=20test.=0A---=0A=20= doc/lispref/parsing.texi=20=20|=2012=20++++++++-=0A=20src/treesit.c=20=20= =20=20=20=20=20=20=20=20=20=20=20|=2056=20= +++++++++++++++++++++++++++------------=0A=20test/src/treesit-tests.el=20= |=2034=20++++++++++++++++++++++++=0A=203=20files=20changed,=2084=20= insertions(+),=2018=20deletions(-)=0A=0Adiff=20--git=20= a/doc/lispref/parsing.texi=20b/doc/lispref/parsing.texi=0Aindex=20= 3223875320a..98582227fd7=20100644=0A---=20a/doc/lispref/parsing.texi=0A= +++=20b/doc/lispref/parsing.texi=0A@@=20-409,6=20+409,14=20@@=20Using=20= Parser=0A=20By=20default,=20this=20function=20reuses=20a=20parser=20if=20= one=20already=20exists=20for=0A=20@var{language}=20in=20@var{buffer},=20= but=20if=20@var{no-reuse}=20is=0A=20non-@code{nil},=20this=20function=20= always=20creates=20a=20new=20parser.=0A+=0A+If=20@var{buffer}=20(or=20= the=20current=20buffer)=20is=20an=20indirect=20buffer,=20its=0A+base=20= buffer=20is=20used=20instead.=20=20That=20is,=20indirect=20buffers=20= uses=20their=0A+base=20buffer's=20parsers.=20=20If=20the=20base=20buffer=20= is=20narrowed,=20an=20indirect=0A+buffer=20might=20not=20be=20able=20to=20= retrieve=20information=20of=20the=20portion=20of=20the=0A+buffer=20text=20= that=20are=20invisible=20in=20the=20base=20buffer.=20=20Lisp=20programs=0A= +should=20widen=20as=20necessary=20should=20they=20want=20to=20use=20a=20= parser=20in=20an=0A+indirect=20buffer.=0A=20@end=20defun=0A=20=0A=20= Given=20a=20parser,=20we=20can=20query=20information=20about=20it.=0A@@=20= -447,7=20+455,9=20@@=20Using=20Parser=0A=20@defun=20treesit-parser-list=20= &optional=20buffer=0A=20This=20function=20returns=20the=20parser=20list=20= of=20@var{buffer}.=20=20If=0A=20@var{buffer}=20is=20@code{nil}=20or=20= omitted,=20it=20defaults=20to=20the=20current=0A-buffer.=0A+buffer.=20=20= If=20@var{buffer}=20(or=20the=20current=20buffer)=20is=20an=20indirect=0A= +buffer,=20its=20base=20buffer=20is=20used=20instead.=20=20That=20is,=20= indirect=20buffers=0A+uses=20their=20base=20buffer's=20parsers.=0A=20= @end=20defun=0A=20=0A=20@defun=20treesit-parser-delete=20parser=0Adiff=20= --git=20a/src/treesit.c=20b/src/treesit.c=0Aindex=20= 8b485ca4ece..74370cd772d=20100644=0A---=20a/src/treesit.c=0A+++=20= b/src/treesit.c=0A@@=20-384,7=20+384,10=20@@=20#define=20= ts_tree_root_node=20fn_ts_tree_root_node=0A=20=20=20=20mysteriously=20= drops.=20=203)=20what=20if=20a=20user=20uses=20so=20many=20stuff=20that=20= the=0A=20=20=20=20default=20cache=20size=20(20)=20is=20not=20enough=20= and=20we=20end=20up=20thrashing?=0A=20=20=20=20These=20are=20all=20= imaginary=20scenarios=20but=20they=20are=20not=20impossible=0A-=20=20=20= :-)=20*/=0A+=20=20=20:-)=0A+=0A+=20=20=20Parsers=20in=20indirect=20= buffers:=20We=20make=20indirect=20buffers=20to=20share=20the=0A+=20=20=20= parser=20of=20its=20base=20buffer.=20=20See=20bug#59693=20for=20= reasoning.=20=20*/=0A=20=0A=20=0C=0A=20/***=20Initialization=20*/=0A@@=20= -697,9=20+700,10=20@@=20treesit_tree_edit_1=20(TSTree=20*tree,=20= ptrdiff_t=20start_byte,=0A=20treesit_record_change=20(ptrdiff_t=20= start_byte,=20ptrdiff_t=20old_end_byte,=0A=20=09=09=20=20=20=20=20=20=20= ptrdiff_t=20new_end_byte)=0A=20{=0A-=20=20Lisp_Object=20parser_list;=0A-=0A= -=20=20parser_list=20=3D=20BVAR=20(current_buffer,=20ts_parser_list);=0A= +=20=20struct=20buffer=20*base_buffer=20=3D=20current_buffer;=0A+=20=20= if=20(current_buffer->base_buffer)=0A+=20=20=20=20base_buffer=20=3D=20= current_buffer->base_buffer;=0A+=20=20Lisp_Object=20parser_list=20=3D=20= BVAR=20(base_buffer,=20ts_parser_list);=0A=20=0A=20=20=20= FOR_EACH_TAIL_SAFE=20(parser_list)=0A=20=20=20=20=20{=0A@@=20-1252,12=20= +1256,19=20@@=20DEFUN=20("treesit-parser-create",=0A=20=20=20=20=20=20=20= =201,=203,=200,=0A=20=20=20=20=20=20=20=20doc:=20/*=20Create=20and=20= return=20a=20parser=20in=20BUFFER=20for=20LANGUAGE.=0A=20=0A-The=20= parser=20is=20automatically=20added=20to=20BUFFER's=20parser=20list,=20= as=0A-returned=20by=20`treesit-parser-list'.=0A-LANGUAGE=20is=20a=20= language=20symbol.=20=20If=20BUFFER=20is=20nil=20or=20omitted,=20it=0A= -defaults=20to=20the=20current=20buffer.=20=20If=20BUFFER=20already=20= has=20a=20parser=20for=0A-LANGUAGE,=20return=20that=20parser,=20but=20if=20= NO-REUSE=20is=20non-nil,=20always=0A-create=20a=20new=20parser.=20=20*/)=0A= +The=20parser=20is=20automatically=20added=20to=20BUFFER's=20parser=20= list,=20as=20returned=0A+by=20`treesit-parser-list'.=20=20LANGUAGE=20is=20= a=20language=20symbol.=20=20If=20BUFFER=0A+is=20nil=20or=20omitted,=20it=20= defaults=20to=20the=20current=20buffer.=20=20If=20BUFFER=0A+already=20= has=20a=20parser=20for=20LANGUAGE,=20return=20that=20parser,=20but=20if=20= NO-REUSE=0A+is=20non-nil,=20always=20create=20a=20new=20parser.=0A+=0A= +If=20BUFFER=20(or=20the=20current=20buffer)=20is=20an=20indirect=20= buffer,=20its=20base=0A+buffer=20is=20used=20instead.=20=20That=20is,=20= indirect=20buffers=20uses=20their=20base=0A+buffer's=20parsers.=20=20If=20= the=20base=20buffer=20is=20narrowed,=20an=20indirect=20buffer=0A+might=20= not=20be=20able=20to=20retrieve=20information=20of=20the=20portion=20of=20= the=20buffer=0A+text=20that=20are=20invisible=20in=20the=20base=20= buffer.=20=20Lisp=20programs=20should=0A+widen=20as=20necessary=20should=20= they=20want=20to=20use=20a=20parser=20in=20an=20indirect=0A+buffer.=20=20= */)=0A=20=20=20(Lisp_Object=20language,=20Lisp_Object=20buffer,=20= Lisp_Object=20no_reuse)=0A=20{=0A=20=20=20treesit_initialize=20();=0A@@=20= -1271,16=20+1282,21=20@@=20DEFUN=20("treesit-parser-create",=0A=20=20=20=20= =20=20=20CHECK_BUFFER=20(buffer);=0A=20=20=20=20=20=20=20buf=20=3D=20= XBUFFER=20(buffer);=0A=20=20=20=20=20}=0A+=20=20if=20(buf->base_buffer)=0A= +=20=20=20=20buf=20=3D=20buf->base_buffer;=0A+=0A=20=20=20= treesit_check_buffer_size=20(buf);=0A=20=0A=20=20=20/*=20See=20if=20we=20= can=20reuse=20a=20parser.=20=20*/=0A-=20=20for=20(Lisp_Object=20tail=20=3D= =20BVAR=20(buf,=20ts_parser_list);=0A-=20=20=20=20=20=20=20NILP=20= (no_reuse)=20&&=20!NILP=20(tail);=0A-=20=20=20=20=20=20=20tail=20=3D=20= XCDR=20(tail))=0A+=20=20if=20(NILP=20(no_reuse))=0A=20=20=20=20=20{=0A-=20= =20=20=20=20=20struct=20Lisp_TS_Parser=20*parser=20=3D=20XTS_PARSER=20= (XCAR=20(tail));=0A-=20=20=20=20=20=20if=20(EQ=20= (parser->language_symbol,=20language))=0A-=09return=20XCAR=20(tail);=0A+=20= =20=20=20=20=20Lisp_Object=20tail=20=3D=20BVAR=20(buf,=20= ts_parser_list);=0A+=20=20=20=20=20=20FOR_EACH_TAIL=20(tail)=0A+=20=20=20= =20=20=20{=0A+=09struct=20Lisp_TS_Parser=20*parser=20=3D=20XTS_PARSER=20= (XCAR=20(tail));=0A+=09if=20(EQ=20(parser->language_symbol,=20language))=0A= +=09=20=20return=20XCAR=20(tail);=0A+=20=20=20=20=20=20}=0A=20=20=20=20=20= }=0A=20=0A=20=20=20/*=20Load=20language.=20=20*/=0A@@=20-1329,7=20= +1345,10=20@@=20DEFUN=20("treesit-parser-list",=0A=20=20=20=20=20=20=20=20= Ftreesit_parser_list,=20Streesit_parser_list,=0A=20=20=20=20=20=20=20=20= 0,=201,=200,=0A=20=20=20=20=20=20=20=20doc:=20/*=20Return=20BUFFER's=20= parser=20list.=0A-BUFFER=20defaults=20to=20the=20current=20buffer.=20=20= */)=0A+=0A+BUFFER=20defaults=20to=20the=20current=20buffer.=20=20If=20= BUFFER=20(or=20the=20current=0A+buffer)=20is=20an=20indirect=20buffer,=20= its=20base=20buffer=20is=20used=20instead.=20=20That=0A+is,=20indirect=20= buffers=20uses=20their=20base=20buffer's=20parsers.=20=20*/)=0A=20=20=20= (Lisp_Object=20buffer)=0A=20{=0A=20=20=20struct=20buffer=20*buf;=0A@@=20= -1340,6=20+1359,9=20@@=20DEFUN=20("treesit-parser-list",=0A=20=20=20=20=20= =20=20CHECK_BUFFER=20(buffer);=0A=20=20=20=20=20=20=20buf=20=3D=20= XBUFFER=20(buffer);=0A=20=20=20=20=20}=0A+=20=20if=20(buf->base_buffer)=0A= +=20=20=20=20buf=20=3D=20buf->base_buffer;=0A+=0A=20=20=20/*=20Return=20= a=20fresh=20list=20so=20messing=20with=20that=20list=20doesn't=20affect=20= our=0A=20=20=20=20=20=20internal=20data.=20=20*/=0A=20=20=20Lisp_Object=20= return_list=20=3D=20Qnil;=0Adiff=20--git=20a/test/src/treesit-tests.el=20= b/test/src/treesit-tests.el=0Aindex=20aba12759c34..1cc2217bd3b=20100644=0A= ---=20a/test/src/treesit-tests.el=0A+++=20b/test/src/treesit-tests.el=0A= @@=20-161,6=20+161,40=20@@=20treesit-node-api=0A=20=20=20=20=20=20=20= (should=20(treesit-node-eq=20root-node=20root-node))=0A=20=20=20=20=20=20= =20(should=20(not=20(treesit-node-eq=20root-node=20doc-node))))))=0A=20=0A= +(ert-deftest=20treesit-indirect-buffer=20()=0A+=20=20"Tests=20for=20= indirect=20buffers."=0A+=20=20(skip-unless=20= (treesit-language-available-p=20'json))=0A+=20=20(let=20((base=20= (get-buffer-create=20"*treesit=20test*"))=0A+=20=20=20=20=20=20=20=20= parser=20indirect)=0A+=20=20=20=20(unwind-protect=0A+=20=20=20=20=20=20=20= =20(progn=0A+=20=20=20=20=20=20=20=20=20=20(with-current-buffer=20base=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(setq=20indirect=20= (clone-indirect-buffer=20"*treesit=20test=201*"=20nil)))=0A+=20=20=20=20=20= =20=20=20=20=20(with-current-buffer=20indirect=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(setq=20parser=20(treesit-parser-create=20'json)))=0A+=20=20=20= =20=20=20=20=20=20=20;;=201.=20Parser=20created=20in=20the=20indirect=20= buffer=20should=20be=0A+=20=20=20=20=20=20=20=20=20=20;;=20actually=20be=20= created=20in=20the=20base=20buffer.=0A+=20=20=20=20=20=20=20=20=20=20= (with-current-buffer=20base=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (should=20(equal=20(list=20parser)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(treesit-parser-list)))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20(insert=20"[1,2,3]"))=0A+=20=20=20=20=20= =20=20=20=20=20;;=20Change=20in=20the=20base=20buffer=20should=20be=20= reflected=20in=20the=0A+=20=20=20=20=20=20=20=20=20=20;;=20indirect=20= buffer.=0A+=20=20=20=20=20=20=20=20=20=20(with-current-buffer=20indirect=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(should=20(eq=20(treesit-node-end=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(treesit-buffer-root-node))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=208))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20(erase-buffer))=0A+=20=20=20=20=20=20=20=20=20=20;;=20Change=20in=20= the=20indirect=20buffer=20should=20be=20reflected=20in=20the=0A+=20=20=20= =20=20=20=20=20=20=20;;=20base=20buffer.=0A+=20=20=20=20=20=20=20=20=20=20= (with-current-buffer=20base=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (should=20(eq=20(treesit-node-end=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(treesit-buffer-root-node))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=201))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(erase-buffer)))=0A+=20=20=20=20=20=20= (kill-buffer=20base)=0A+=20=20=20=20=20=20(kill-buffer=20indirect))))=0A= +=0A=20(ert-deftest=20treesit-query-api=20()=0A=20=20=20"Tests=20for=20= query=20API."=0A=20=20=20(skip-unless=20(treesit-language-available-p=20= 'json))=0A--=20=0A2.33.1=0A=0A= --Apple-Mail=_33EA85EC-285A-4797-BC72-7219836DFFD9 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_33EA85EC-285A-4797-BC72-7219836DFFD9--