From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59630: 29.0.50; treesitter-buffer-root-node doesn't change when changing buffer restriction Date: Sun, 27 Nov 2022 13:49:08 +0100 Message-ID: <87zgcc1s1n.fsf@miha-pc> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31497"; mail-complaints-to="usenet@ciao.gmane.io" To: 59630@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 13:49:29 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 1ozH67-0007tZ-SQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 13:49:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozH5n-0004Kv-Cu; Sun, 27 Nov 2022 07:49:07 -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 1ozH5j-0004Kh-RL for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:49:04 -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 1ozH5j-0005Vh-1j for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:49:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozH5h-0004LP-TN for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 12:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59630 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166955329716690 (code B ref -1); Sun, 27 Nov 2022 12:49:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 12:48:17 +0000 Original-Received: from localhost ([127.0.0.1]:42248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozH4y-0004L8-UJ for submit@debbugs.gnu.org; Sun, 27 Nov 2022 07:48:17 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:55062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozH4w-0004Ks-IP for submit@debbugs.gnu.org; Sun, 27 Nov 2022 07:48:15 -0500 Original-Received: from [2001:470:142:3::10] (helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozH4l-0004HF-9A for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:48:04 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozH4a-0005TU-1P for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:47:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669553269; bh=zEzGhe1Z5GK5GfVmAZCAKJcLv4J88LTeT0W9JrDnT/A=; h=From:To:Subject:Date:From; b=qLlnQsQZtcwPgnwIncmgoOlnsZvWntBvCPRC+1+ZGHJdsuGz+AVLRB40/ZLCduHvu ID/M4IrKSIIJDqF9dX1HekqTzVjxnQicFbUE+nOkF9BW5lbZT/LdfPa3zRZ/JLl2f5 /iQGEGTdj5tGzNY8DbXNQvWlNWZeRayXDE41Bt513v894hs1ZAVc4+cVg+JVDdy53d 2QHBOcWOLEqXXvpfEa1166APw52lI3NeNGSTAmLmfpqWTqj8CllmUm/nO7NfAE4Sdz nAYFW2ohxjXIks6tzwxIsAZh8jn24z9pA5kDKjsesTRaFxHew3m+M+7AxCHp2CQgex 9nHnNcuN/2Qmg== Received-SPF: pass client-ip=209.250.245.214; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 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, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=0.695, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:249207 Archived-At: --=-=-= Content-Type: text/plain Treesitter doesn't seem to change its parse tree when changing restriction. It gets it correct the first time when we query the root node, but then, after changing restriction, it doesn't seem to get updated. The following is an M-x ielm session to demonstrate the problem ELISP> (set-buffer (get-buffer-create "test")) ELISP> (insert "echo '123'") ELISP> (narrow-to-region 1 4) ELISP> (buffer-string) "echo" ELISP> (treesit-buffer-root-node 'bash) # ;; This is expected ELISP> (widen) ELISP> (treesit-buffer-root-node 'bash) # ;; <---- This is not expected, the root node should span 1-9 ELISP> (buffer-string) "echo '123'" --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODXMQTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP5kRD/oD8EI0Zn6ngw8TciPpg2JKcoRXeI4f /MwQgPI8Ul/Krck+wR+DiYahLCuh6RX5h52PMFBrKiM/56DpkKpqKoH0cpZpzTT9 y4YUSsYttvFs0fihdDuW9QGeypdwA0S5p7T/FxtvSathSP8d9xeInZFsz1MM3EC1 RVhJhGt8klObqurblp++zsXWpIWzTTvnAlYH/LFrXBgDYoQAdF1QMQMmyaPh+7zk vsTl6SsbuIWoTZGdOfLLq/hHMnyAW3JAj23z1K4HfbovqhTOoNqNIyCYpEH2hw2A BlmcjWy5IyMsgzetM9FaKJs/79AX2ZukoW94YOJ3+zppnxF6Dye4O2R0LYs/zece sJ9rUM1K5gcwPtDBFz7CRxTdZiJq9NOADLPwcGiEpY9rOq6ilEyz9CR81H3x7wrD rfoGwlpQF3XS890VzZCnEW8u7SRlfL/rwBSct57TByVVWvIQSl+wcy5ZmkJnlFw9 HwDpFCOUXd4i8GA1ULgqkh9DVvZePkTJ9G7Ur1R56PT5KVNdRCi8XATTKFW6WxVk b5f6PkyAVtYnnI4btpz0JEBAKu2V9kJ2iJmn6fHV+/S7AxJVWTJjTMiNP1PcVmjz +nRyyUdot9X3qYauMyK+g3EPTgz9s2zztLp2BfBH+UuZ8HL+ecY0t8+/M7qDBl62 TP/L/YqZ/4zH/w== =j85y -----END PGP SIGNATURE----- --=-=-=--