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: Recent updates to tree-sitter branch Date: Sat, 24 Sep 2022 21:27:40 -0700 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.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="38053"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 25 06:29:09 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 1ocJGP-0009nY-4y for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Sep 2022 06:29:09 +0200 Original-Received: from localhost ([::1]:50286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocJGM-0003rN-E0 for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Sep 2022 00:29:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocJF5-0002oc-Qq for emacs-devel@gnu.org; Sun, 25 Sep 2022 00:27:48 -0400 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:34335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocJF4-0007Ji-4P for emacs-devel@gnu.org; Sun, 25 Sep 2022 00:27:47 -0400 Original-Received: by mail-pj1-x102c.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso10312506pjq.1 for ; Sat, 24 Sep 2022 21:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date; bh=58EXf+u7ixqZvGgvepVJ6BzUQi+SoS8WYJu17IsPiLw=; b=DP66FS8iGfKXXeM/TQpK1t3icuqVzwO2ZWq2EFEbmjm7/txXokWDN5gy/mJSDWCwNe KptE1OqUEwoQRPn7D1wPKUg3W9G4gUNUonVCm59sIUiwa6zMm3D502DB3kb9VhwKXdch MI/i3SnzuoMxepsInhTQWkIW5ibThy94Lg6QGySl+sbCsGUU7syDGo+YmjhExKYLzYk0 njeTERPorhJRrK4MPKukTTcVmIf1VtYuVVifrjSy7dNAOBMY3/y/VRdkafSM3FzuIXef fIhTQkWnl10lR08Uv32ZC4oLNWpojZcJ8l8zDzQ4KDcnBq/V+yHtdt+psB1bkN2gUdYP 0b3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date; bh=58EXf+u7ixqZvGgvepVJ6BzUQi+SoS8WYJu17IsPiLw=; b=EaiPKvOLDl3Co6wpTtsjD/7fIF6ahEx3ZJbrGGOEzkXEwn8JnasmmqyD4eWxJrUdau PDlAkzMBrLAvkiZ0A9qca2hn6rxMcKavBhpWkox1+D9zugmGEsfQy6y9obU7AiKusCgX yT17NF6niD0P7IQAkRrdurf1ZfrQIiBvXN3BjYGpkpaeLKqeMB1fcWDx8srHGIJ5Gnck vwfcS6UdHzeym0VND765SZn8eFydCN6UFS+hg4Gyd628szcVoRk3q4wC/9RqtMtODSlg vrwDMm/QxeXhZa3JBT371rvHCCAQQ13EZzNKxa3oKxFPtLFrVTvcPTZWq+b5uP63yJlT zTbQ== X-Gm-Message-State: ACrzQf1C7kCqOvApSMrYUoR65tnkLAjB+Z9wEcrJtTICFurdtPnlSgaL 1pO24c/U/kNJ9euBx8XZUbM7BYX50bg= X-Google-Smtp-Source: AMsMyM4uB7cifXeUh8VkqrtaxRcgO9nfK8Tfh/y7rPY48WxnvRZJWuIrPW7/5XLF5kxmv6W5SyGyeQ== X-Received: by 2002:a17:902:e744:b0:178:6d7b:6d08 with SMTP id p4-20020a170902e74400b001786d7b6d08mr16440108plf.128.1664080064323; Sat, 24 Sep 2022 21:27:44 -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 e2-20020a63f542000000b0043a09d5c32bsm8058294pgk.74.2022.09.24.21.27.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2022 21:27:43 -0700 (PDT) X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=casouri@gmail.com; helo=mail-pj1-x102c.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" Xref: news.gmane.io gmane.emacs.devel:296190 Archived-At: Hi, I=E2=80=99ve recently made some breaking changes and added some goodies = to the tree-sitter branch. If anyone have used that branch for =E2=80=A6 = stuff, please have a look at these changes: 1. I reworked the tree-traversal functions=E2=80=94moved them from lisp = to C, and changed their name and signature: treesit-traverse-depth-first -> treesit-search-subtree treesit-traverse-breadth-first -> treesit-traverse-forward -> treesit-search-forward treesit-search-forward -> treesit-search-forward-goto treesit-search-beginning/end -> treesit-search-forward-goto -> treesit-induce-sparse-tree Treesit-induce-sparse-tree is very good for very quickly extracting a = tree containing only nodes that satisfy some condition. Maybe it should = be called treesit-extract-sparse-tree? =E2=80=9CSparse tree=E2=80=9D is = an invented word, I=E2=80=99m not aware of a good terminology for this = kind of induced tree. 2. Although treesit-font-lock-settings didn=E2=80=99t change, = treesit-font-lock-defaults is abandoned. You are also now supposed to = use treesit-font-lock-rules to build the queries and set it to = treesit-font-lock-settings. It is much cleaner than setting = treesit-font-lock-settings manually. Basically: (setq treesit-font-lock-defaults ...) | V (setq treesit-font-lock-settings (treesit-font-lock-rules ...)) 3. I removed treesit-defun-query, treesit-beginning/end-of-defun. That=E2=80=99s it! Happy hacking. Yuan=