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: Question on getting tree-sitter matches Date: Sun, 19 Mar 2023 14:59:58 -0700 Message-ID: <4C74116B-D2D3-4C48-A966-A7F4DBB9C330@gmail.com> References: <87cz5ekpl9.fsf@meain.io> <877cvle3c3.fsf@meain.io> <874jqmej5y.fsf@meain.io> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) 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="24537"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Abin Simon Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 19 23:01:10 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 1pe15S-0006E3-MC for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Mar 2023 23:01:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pe14Z-0007Eq-Qp; Sun, 19 Mar 2023 18:00:15 -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 1pe14Y-0007Eb-6E for emacs-devel@gnu.org; Sun, 19 Mar 2023 18:00:14 -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 1pe14W-0007Nx-FY for emacs-devel@gnu.org; Sun, 19 Mar 2023 18:00:13 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id fb38so951401pfb.7 for ; Sun, 19 Mar 2023 15:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679263211; 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=++MJ6u+fvOdN8jDM2yLJY5K3G+iF1KHjj6b+ROgNOoU=; b=Ly5ZU5xG+n7co1MXpgWtELwTX/VgV19f6KUxMcKQt39GdtPqlB49hcPlf+VRrqk8Y5 NTFk4Hci+/NzdnUnfI+6twrdo9zFFTnKiCzUgUgIiH4e49zX/at6T+yHou89Y8vgu2Gq rl0uUkYNrRRrnOYgGqZASvKpHABlknSBMT6FoCsfUEThH2ZEubEVnzv/p8/wN8yjJs0O BoO1fiAfk2HBpFeemxB/59y3kmJgbN6YHcePaZyEfwBzMw83NGzj9cDBIUWO3Lealebu auNW0F8uTi/ynXtybnqXzkFtKA85iFoxEQ6K+ucffvgsdK18ytXUCbooPBImG/5eifsZ hw2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679263211; 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=++MJ6u+fvOdN8jDM2yLJY5K3G+iF1KHjj6b+ROgNOoU=; b=mQUZXeQofKOapunhY7jvyfwz9snliZrxg9RBLyq4iAPh3R4I7fxfgux/PbzhQaravP zZLvx7pYtbn7hiNOrs1YE1l8DNo3ya1g4GS9cyME69pfQOEYFri+KMUjDKYPSLAfrozW xQSzrNmgS5lZJ3PlVggxIeP+eJKuAr/O00IZDOQRRZFyoIty0rlJ91v4Bj6oM3ZCVGp0 bP9jKOiuC1paYdXlqQRTaizs59S/wF6RKX70QaaImpljpnuvTKx+T0mB9wO4aGc34nsB k+iIrhsThVl0ZLsHJQtxKU0U45BrERIyIItocv8l9RtewTCP7IwpmMqsW9xM6FeeEx+S i2iQ== X-Gm-Message-State: AO0yUKXlwINOLdwCpw5X3ANAavY0dxY+4F9BsFYKyw0q9kl8YQSs0tPm Ariv3pr3eSIxVZZkJajwHT0cb0qdw4vX4w== X-Google-Smtp-Source: AK7set91/h38H6D9dEUgLIXh7nJviPqVoipP5RefB0nXgLtOZNb9fwfWOxuDEwtK0D/+YJe4Dbuw5g== X-Received: by 2002:aa7:985e:0:b0:625:ea57:389b with SMTP id n30-20020aa7985e000000b00625ea57389bmr12687313pfq.5.1679263210838; Sun, 19 Mar 2023 15:00:10 -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 b1-20020a6567c1000000b005023496e339sm4888730pgs.63.2023.03.19.15.00.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Mar 2023 15:00:10 -0700 (PDT) In-Reply-To: <874jqmej5y.fsf@meain.io> X-Mailer: Apple Mail (2.3731.400.51.1.1) 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:304585 Archived-At: > On Mar 14, 2023, at 9:24 PM, Abin Simon wrote: >=20 >> I see. We can add an optional argument to treesit-query-capture to = toggle the =E2=80=9Cgrouping=E2=80=9D of matches, WDYT? >=20 > That would work for my current usecase. >=20 > 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. =46rom = a > quick scan of Neovim docs, they too seem to have two functions with > similar names. For your particular use, would it be better to add a separate function = or a flag to treesit-query-capture? Yuan=