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.devel Subject: Re: Questions about tree-sitter Date: Wed, 13 Sep 2023 21:11:54 -0700 Message-ID: <8ECA1B2A-CAB9-4500-A193-3A898A382C4C@gmail.com> References: <12fe5895-7d34-4f3e-b1cf-aa133b718c24@mailo.com> <52f09345-85c8-4049-b12d-bf8b84b08f75@mailo.com> <2B46C452-DC8B-4BD0-A64B-8773235C1FA8@gmail.com> <3b3f90e8-a318-4b63-915e-6477701de897@mailo.com> <1F227B69-6195-4115-A7B6-BD2F7EA08E1F@gmail.com> <2E2323FB-1A32-48B6-992E-66F474427199@gmail.com> <9fef551c-3a8d-4df8-ac1d-a9884b73da5d@mailo.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5890"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: =?utf-8?B?IkF1Z3VzdGluIENow6luZWF1IChCVHVpbiki?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 14 06:12:37 2023 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 1qgdiX-0001KG-Qq for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Sep 2023 06:12:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgdi8-000718-8c; Thu, 14 Sep 2023 00:12:12 -0400 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 1qgdi5-00070u-L1 for emacs-devel@gnu.org; Thu, 14 Sep 2023 00:12:09 -0400 Original-Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgdi4-0007GG-2B for emacs-devel@gnu.org; Thu, 14 Sep 2023 00:12:09 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68fac16ee5fso465633b3a.1 for ; Wed, 13 Sep 2023 21:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694664726; x=1695269526; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ziMy4Fnym/DA2PQiUqMLTC6AJaIIPBx/5+LYy7hGbI4=; b=EUirVUslXeX76D6DFaAaYNsNEM8UNQAKxZaTgoDjvSEOybd13rNJB95mGFkG+hfILw 8xVPrLvKMdpOWKjjsQuh6vsqX7TGvTwolUQpMalQMpUSCbdXJ0PFNvnxxnd02wW2NIKL ANYAdiR1azv+qvf0a//eaXFxHRVMKA+Kzaid8NIRxhzpi5TBJl2M0W7PIG4wwqj97G7l qftUAQNKAh9xtKKRIOo8It+4x1EkqncEn5CGYqCmsirc2l5UXh/rnekj8cVAkQtPTrV3 /RccuSN0Pw8iotE2BzGpmX8MmRFULS6iiMRBFLqOKXY7Q/T9SIRdChwNoKZBayXVZsK+ 3sFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694664726; x=1695269526; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ziMy4Fnym/DA2PQiUqMLTC6AJaIIPBx/5+LYy7hGbI4=; b=szoet9UTkNP0doMr6CYDReBwgkit3O1Pj2zw7cOI2ewFsAft4ZVhef2uXhHVvYSH91 w9967xnocM+bng8l7sh7mVODIDeAFJLh1HDrWHQHTFv8yNOA7LhsyKM/dlUA35vAgvMi 5kRyw1QFZnQYjVnvGwuCO0wG50yi4mg4TLgRuDUigV6obaLCHHx55DtRnGlz92H9ifzk w1ZKTeGkMsoSFZ6qx42mfBH/6XUftik2gvXeHZAPVrl7wezFLVo9LIYtaHnYqJ8uqOOo zdd59ii8nxslahK1GVxgAJK96nEGesmAWMJXUxquKlq632Ud+R7thfND1buobrKOYxKa iMog== X-Gm-Message-State: AOJu0Yy4p9v9kgHbuqfSRr8hxsLNQFw+nADzyc0cS2gTxMar82vItq1E gfbblElm7ow49XJytq4EOtp4a2Sjb8Q= X-Google-Smtp-Source: AGHT+IGhcmH7QPZjmpXA61D28FzI9CtSA5tjnaGdjIPNw15IzmqtQimAj75jJIGysG/sOnVRFBI2MA== X-Received: by 2002:a05:6a21:7988:b0:157:609f:6057 with SMTP id bh8-20020a056a21798800b00157609f6057mr3709493pzc.27.1694664725800; Wed, 13 Sep 2023 21:12:05 -0700 (PDT) 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 y10-20020a170902b48a00b001bdc8a5e96csm416066plr.169.2023.09.13.21.12.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2023 21:12:05 -0700 (PDT) In-Reply-To: <9fef551c-3a8d-4df8-ac1d-a9884b73da5d@mailo.com> X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=casouri@gmail.com; helo=mail-pf1-x434.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:310563 Archived-At: > On Sep 13, 2023, at 5:43 AM, Augustin Ch=C3=A9neau (BTuin) = wrote: >=20 > Le 12/09/2023 =C3=A0 02:22, Yuan Fu a =C3=A9crit : >>> On Sep 9, 2023, at 9:39 AM, Augustin Ch=C3=A9neau (BTuin) = wrote: >>>=20 >>> Le 08/09/2023 =C3=A0 18:43, Yuan Fu a =C3=A9crit : >>>>> On Sep 8, 2023, at 4:53 AM, Augustin Ch=C3=A9neau (BTuin) = wrote: >>>>>=20 >>>>> Le 06/09/2023 =C3=A0 06:07, Yuan Fu a =C3=A9crit : >>>>>> I added local parser support to master. If everything goes right, = you just need to add a :local t flag in treesit-range-rules. Check out = the modified bision-ts-mode.el that I hacked up for an example. BTW, = it=E2=80=99s vital that you define treesit-language-at-point-function = for a multi-language mode. >>>>>> Yuan >>>>>=20 >>>>> Thanks a lot! >>>>>=20 >>>>> I did some tests and it's working pretty well. >>>> Awesome! >>>=20 >>>=20 >>> It seems I spoke a bit too soon :( >>> When I edit the buffer, sometimes there is an offset between the = text and the nodes after modifying the buffer, or the syntax = highlighting breaks in C code. >>>=20 >>> I attached an example Bison file if needed. >> Thanks. I was able to reproduce this, but then can=E2=80=99t. I=E2=80=99= ll keep looking into this, if you found out something new please let me = know. >=20 > It may be unrelated, but I have this popping in *Messages* sometimes: >=20 > Error during redisplay: (jit-lock-function 1410) signaled = (treesit-load-language-error not-found ("libtree-sitter-nil" = "libtree-sitter-nil.0" "libtree-sitter-nil.0.0" "libtree-sitter-nil.so" = "libtree-sitter-nil.so.0" "libtree-sitter-nil.so.0.0") "No such file or = directory=E2=80=9D) Thanks. I=E2=80=99ve fixed that and some other problems. Please pull = master and try it out. Now bison-ts-mode works pretty well for me. I = can=E2=80=99t reproduce the offset problem anymore, maybe it=E2=80=99s = fixed in some of the fixes I made. Anyway, let me know if you observe it = again. Yuan