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: Question on getting tree-sitter matches Date: Wed, 15 Mar 2023 09:54:25 +0530 Message-ID: <874jqmej5y.fsf@meain.io> References: <87cz5ekpl9.fsf@meain.io> <877cvle3c3.fsf@meain.io> Mime-Version: 1.0 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="37593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 15 13:22:28 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 1pcQ9C-0009QW-J0 for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Mar 2023 13:22:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcQ8V-0003jC-13; Wed, 15 Mar 2023 08:21:43 -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 1pcIgq-00050c-6p for emacs-devel@gnu.org; Wed, 15 Mar 2023 00:24:40 -0400 Original-Received: from sender4-op-o12.zoho.com ([136.143.188.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcIgo-0006tl-ME for emacs-devel@gnu.org; Wed, 15 Mar 2023 00:24:39 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1678854272; cv=none; d=zohomail.com; s=zohoarc; b=Mc9f+G3WnXdCebA8fvxM4IPNAEiksQmfxNYX1ZuOua5r/86XBbhg2o/pf3VCRAjtyS38LOfvNaegRmM3WvE8rren9vRPMkvknd9r3Fv6beq/o31/AYlFi5LnVJcMGmMGhPivpoywVgocwWMNCbAdhQHRZ+u8/Ws2RyX9o8mUPr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678854272; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=/vLtDBlWW2cq6662rg1nVJtz5XmPBTdvvCcs4Ihszx0=; b=ZlVVO90pFxSvbnupyBlRWtBVlWujRdYRd/V9mE0WESWKiOq0vB+UtQKlApSK1JtIUE1NDYaiB9ktm42CbkjitYp2UQ3EXej2+5Ebk8LHm9VCg4wqFFYE8y7DqYm52wYZzN80C45S1uy9c4hCZtNUrcDFkDxJVum6BTw9YnM58r4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=meain.io; spf=pass smtp.mailfrom=mail@meain.io; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1678854272; s=zmail; d=meain.io; i=mail@meain.io; h=From:From:To:To:Cc:Cc:Subject:Subject:In-Reply-To:References:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=/vLtDBlWW2cq6662rg1nVJtz5XmPBTdvvCcs4Ihszx0=; b=T8/j1hk1jA00lHjYeVgPUIzhg3sSOUB2g5qFrsJljVeXTswnQQp6fVFGDECGce7B 6CdGXOIwQCuKFX02gMBy1MxxHUuPYN+2rXrzdgDnxXY3C9b/73gTyxBu7m2mLanJXG/ /RxLrJC6rqXLRctp21C59ZuM9jbIEj8K7tsmbDFc= Original-Received: from localhost (103.85.206.21 [103.85.206.21]) by mx.zohomail.com with SMTPS id 1678854271590281.5397039288779; Tue, 14 Mar 2023 21:24:31 -0700 (PDT) In-Reply-To: X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.12; envelope-from=mail@meain.io; helo=sender4-op-o12.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 15 Mar 2023 08:21:40 -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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304491 Archived-At: > I see. We can add an optional argument to treesit-query-capture to toggle= the =E2=80=9Cgrouping=E2=80=9D of matches, WDYT? That would work for my current usecase. With that said, I would like to point out that elisp-tree-sitter has two methods with one named captures returning a list of captures and one named matches which returns the "grouped" captures(along with pattern index). I'm not sure if these names have any semantic meaning. From a quick scan of Neovim docs, they too seem to have two functions with similar names.