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: Question on getting tree-sitter matches Date: Sun, 12 Mar 2023 20:02:18 +0530 Message-ID: <87cz5ekpl9.fsf@meain.io> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34310"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 12 15:44:22 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 1pbMvu-0008it-K2 for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Mar 2023 15:44:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbMvX-0003AJ-F6; Sun, 12 Mar 2023 10:44:00 -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 1pbMkS-0000Jf-JZ for emacs-devel@gnu.org; Sun, 12 Mar 2023 10:32:32 -0400 Original-Received: from sender4-op-o14.zoho.com ([136.143.188.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbMkQ-0008Hn-Uj for emacs-devel@gnu.org; Sun, 12 Mar 2023 10:32:32 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1678631546; cv=none; d=zohomail.com; s=zohoarc; b=DElSMr+mzcE9NflLW4E7Yzxx45Ny5e1ZGElGlz7Utn/7eCDEF0JJV/wOndZ19ogE7Kh3iFeDZPn9ak7mPxUdEcq5M3J48ZdtTxtiCAufdT7d8feQ4tP1He8NsVAJjtEtcwert7dRXQB5Vw+/FClgpyQzQMpmSGxvrnWpj5xFoAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678631546; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=XzIOPjoyAJ1UsfaP375MNVhZ0fwoJVwPVc94NV5jWXU=; b=GuYOPeo8ohw2Nm+lkyG5byMCln+uXSVAzg711Rw8w0OYcx1zkd3A51NM81kP1L0hb+7MY/GieHkIqc71ubxFm7gsQBiHYQhWIGD1mBC5tRxcwCHD1UHSGC5j310ArONpW3uvEMHOicGO503JbIuN4kWNlYe5VGkzqIT5QLup22U= 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=1678631546; s=zmail; d=meain.io; i=mail@meain.io; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=XzIOPjoyAJ1UsfaP375MNVhZ0fwoJVwPVc94NV5jWXU=; b=YTiLXNs8iHe7XIktJRm4FHDK69A/c8ImM2shZuoZHI95HzHdFuB0ghauUxpF5+HG GfWmu3/IIrH0lWJGRNSdKlfrPfGyFobH3L3EUWc/f6aUSs+kNdGWApj/l83UorJ7nIu ZS/Q+4QR7BjFboC8/C/bqTnX12cpWCns5qtYrdao= Original-Received: from localhost (103.85.206.21 [103.85.206.21]) by mx.zohomail.com with SMTPS id 1678631544390189.12429206279432; Sun, 12 Mar 2023 07:32:24 -0700 (PDT) X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.14; envelope-from=mail@meain.io; helo=sender4-op-o14.zoho.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 12 Mar 2023 10:43:46 -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:304371 Archived-At: Hey, How would I get the set of matches from tree-sitter with items from the same query together. For example if I have a query of the following form: (function_declaration (identifier) @id) @func elisp-tree-sitter returns this as the output of `tsc-query-matches`: [(0 . [ (func . #) (id . #) ] ) (0 . [ (func . #) (id . #) ] ) ] This groups the matches from the same "query" together. I could only find `treesit-query-capture` which just returns a list of captures items in the following form: ( (func . #) (id . #) (func . #) (id . #) )