From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simon Pugnet Newsgroups: gmane.emacs.devel Subject: Tree sitter: allowing access to `ts_tree_get_changed_ranges()' from elisp Date: Sat, 26 Nov 2022 15:57:33 +0100 Message-ID: <87mt8dep1e.fsf@polaris64.net> 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="22327"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 26 16:26:03 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 1oyx47-0005d9-99 for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Nov 2022 16:26:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyx3U-0008JR-BU; Sat, 26 Nov 2022 10:25:24 -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 1oywiN-00037E-Ui for emacs-devel@gnu.org; Sat, 26 Nov 2022 10:03:35 -0500 Original-Received: from mout-y-111.mailbox.org ([91.198.250.236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1oywiL-0002ko-Hn for emacs-devel@gnu.org; Sat, 26 Nov 2022 10:03:35 -0500 Original-Received: from smtp102.mailbox.org (unknown [91.198.250.119]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4NKFNb6vYXz9sLy for ; Sat, 26 Nov 2022 16:03:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polaris64.net; s=MBO0001; t=1669475008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=/LT2J7b37CFceLvtgWNePx4QZ+4VT0CS+3I6M+iQSy0=; b=nTtOtYup5Vx6kJx9iYSTLpHpjtYPLYTxCvrm9OQYYsvtps0qYxzDX3cpnUfECBwAmN06iX QuBL1xgrhHzlPmVBhNsTgDhJORKEUi+zpIaOZgr19/XhIU9f6rsFUeLRPgYAbP6NPGRn1v NErLgrXYh1xGIV1e9oZEjDSSibT8n7KVN1YuaMtoNtilqyyfZfd1Z47aAMqb7mg7BwZ1bi 0Ddo/yHXJjXy55Bxq32/As0CiYyOpfn0b2029Dkn4SSE4tPULlgdTcpVrejQ+5vat32qxr owcd6WDO/wFYNxo5abo12JT9RBeSHIdaK8gRXJiGeCBAGqFwhQFAAom4mCo8EQ== X-Rspamd-Queue-Id: 4NKFNb6vYXz9sLy Received-SPF: pass client-ip=91.198.250.236; envelope-from=simon@polaris64.net; helo=mout-y-111.mailbox.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 26 Nov 2022 10:25:23 -0500 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:300571 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Dear Emacs developers, I'm a contributor to Symex.el=20 (), a structural editing package=20 based on Evil. The core package was originally designed to be used=20 with Lisp languages but I have been working on it to add support for=20 other languages via Tree Sitter. This work has been going on for quite a while so I am currently using=20 Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n's `elisp-tree-sitter' package=20 (). As Yuan=20 Fu's tree-sitter branch has just been merged I decided this was a good=20 time to look into updating Symex.el so that it can use the built-in=20 version instead when it's available. Progress so far has been good and I have a large portion of the=20 functionality working with both implementations. However I've just=20 found a feature that I'm using in `elisp-tree-sitter' that does not=20 seem to be available in the built-in version. Part of the functionality I use is fetching a list of ranges that have=20 been changed between the previous and current parser trees (after an=20 editing operation). This is exposed by `elisp-tree-sitter' via the=20 `tsc-changed-ranges' function. From the docstring, "=E2=80=A6This function= =20 returns a sequence of ranges whose syntactic structure has changed." I=20 can't find an equivalent function exposed by the built-in tree sitter=20 library however. I've checked src/treesit.c and I can see that there is a=20 `ts_tree_get_changed_ranges()' function, presumably from the=20 underlying tree sitter library. However I don't think this is being=20 exposed to elisp. Would it be possible to allow this information to be=20 provided to elisp somehow? Thanks in advance for your help, and apologies if this is already=20 available and I have simply missed it. Kind regards, =2D-=20 Simon Pugnet https://www.polaris64.net/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCAAyFiEEO/eF3hYsAMj7Tab9uhNZqCwLPvkFAmOCKr0UHHNpbW9uQHBv bGFyaXM2NC5uZXQACgkQuhNZqCwLPvnYkg/+Oq+hPlALYWBp/ZVgkGRhRXeqehxl iEPWzF1tZ03xgAePf/qV4iI6cXStQckLlD8VdKfedtjlwjQCuPW0mruJeTo9dFR+ N0IhvraZhLcZ3rTjLWQKjRudX7nMwZBnuHbGjXuZfykkSHsbg6C0JJAX5+i1c2D9 8C7P7q4EJLPBFcoRwAFocC1seUb9HH+j5La/o7dmVKz6S36zOKsH6smnTTrfQmcg MPPZEuSYQHp784IMy9a2Gi8rzb8v4OJ/9DAfs6Zh0IUdqxgugoyRzQMcr9Kb9kdm lLRX0j7tcCsCMW253mPSd0NBEM35Ru4btAaVPcpSBJRMtTt4sA3da4+hvXQSEG3/ Fm1pv6EHeKxAhWezHTGnee0CjiB9hMMYMnrux9AOndteNivPqgAvTn5ktG7g4kG0 M8TISej790a+O56n9OIL5D6qpl9i2a8SEs/uCqt7MTeDfZ2eRjXL8336Pk+AJKsL hldJR4fLwc0/GMizmsr7NZsJqDByo4OCd/sgSYTytzURFHw4RJFBVIKvm1Z7pc6/ XsrcHN4Ui0vKvnJnCnvDZFbeHmno2TDAQSYklMLlgsXEKq2FxNTFeQkqxlNLF/Av Unp+Sb8j2yCPwuYbqJ4JMixbVtIvk4IIcqr1sDMPhPsv2H0Qot6NuZHISqOaIuVi yF2c6xi/DPpFg3g= =Mebw -----END PGP SIGNATURE----- --=-=-=--