From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Abin Simon Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Thu, 30 Jun 2022 19:59:41 +0530 Message-ID: <87k08ygr6y.fsf@meain.io> References: <87tu83pbth.fsf@gmail.com> <87y1xeb93m.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32810"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, eliz@gnu.org, theo@thornhill.no, monnier@iro.umontreal.ca, dancol@dancol.org, emacs-devel@gnu.org To: Yoav Marco , Abin Simon Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 30 17:54:24 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 1o6wUq-0008ND-FX for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jun 2022 17:54:24 +0200 Original-Received: from localhost ([::1]:37326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6wUp-00049F-JH for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jun 2022 11:54:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6vAy-0006q0-Lo for emacs-devel@gnu.org; Thu, 30 Jun 2022 10:29:48 -0400 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:44607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6vAw-00080U-RA; Thu, 30 Jun 2022 10:29:48 -0400 Original-Received: by mail-pf1-f181.google.com with SMTP id 65so18287561pfw.11; Thu, 30 Jun 2022 07:29:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:cc:subject:in-reply-to:references :date:message-id:mime-version; bh=dcnScJyflY2AfwIbGbpeLpXPtco1IETFuLMfZ4p2DZU=; b=VJj3hQRmkojZD0gaXRqA4ezNOSqSbrQ03eVxvyJRnCNOCRopF3T1L5DixAx9ZlK9x5 pHOHnY0WW1ejwJ90qYMSH9JpSaxlTSA+NtBnxckvBmfn1FlQQnmOpaBuCjr7HQyUPlcb gFm+ZxiMhpmrbTiRco/vHGmWMPM6gCz/x9YuAx5KB0KYQWRA5E7Bf/D0zOdstA3dNbKI xxiQMZCVzsdXh4mUyHkBs0WGojw37vsFJHNcSmFmV/jgFQaVs9r747T1fmQrL1GPau+w N0VEAzk9e8q7WF50CV6hVVtDV/53Kxrg7DsGdqyoXQqU43yT0tv5DHLYWAJQoRrLccdE d4JQ== X-Gm-Message-State: AJIora9VbxKb0BXsucSgnb6fKORCO9tgBO2pOu4m8DTGxZRh/cyypZR6 CqBhfbCt9ywce4EhGLLnuF0= X-Google-Smtp-Source: AGRyM1uFSUUYelnjU0VoVKvcrS79yT1aIe6+/5M+51a/RVQbYKiBaptHgdjrYzlWAKP505Jrwd5YMQ== X-Received: by 2002:a63:f307:0:b0:411:a0b8:d3a with SMTP id l7-20020a63f307000000b00411a0b80d3amr3406535pgh.543.1656599384730; Thu, 30 Jun 2022 07:29:44 -0700 (PDT) Original-Received: from localhost ([103.165.21.236]) by smtp.gmail.com with ESMTPSA id v22-20020a17090a0e1600b001ecbd9aa1a7sm4617136pje.1.2022.06.30.07.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 07:29:44 -0700 (PDT) In-Reply-To: <87y1xeb93m.fsf@gmail.com> Received-SPF: pass client-ip=209.85.210.181; envelope-from=abinsimon10@gmail.com; helo=mail-pf1-f181.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 30 Jun 2022 11:53:23 -0400 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" Xref: news.gmane.io gmane.emacs.devel:291748 Archived-At: Yoav Marco writes: > I dug a little through the neovim code. #make-range! is implemented in > nvim-treesitter, not mainline neovim. And they don't create a new node > for the range, just compute the range itself. > > I think the best course of action is to support elisp predicates in some > way, and let users post-process the output of treesit-query-capture if > they added queries that return non-boolean results. Yeah, I think this would probably work out pretty well, at least for my usecase. > I see you wrote a go program to pre-process #make-range!. I also had to do > something similar in > https://github.com/emacs-tree-sitter/tree-sitter-langs/pull/99 > due to predicate incompatibility, though I do it in Elisp right after > reading the query file. So I guess it's a valid solution too. Ahh, that makes sense. I just went with go just because I was bit more confortable writing the "parser" in go.