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: Tree-sitter, using treesit-range-rules for embedded languages Date: Tue, 22 Nov 2022 11:28:48 -0800 Message-ID: <158606F8-9A2E-4630-A441-2BEAA07EB137@gmail.com> References: <87o7syaon6.fsf@gmail.com> 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="32769"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Wilhelm Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 22 20:29:41 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 1oxYxh-0008P3-Sk for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Nov 2022 20:29:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxYwx-0007ne-EI; Tue, 22 Nov 2022 14:28:55 -0500 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 1oxYwv-0007nH-Px for emacs-devel@gnu.org; Tue, 22 Nov 2022 14:28:54 -0500 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxYwu-0008Na-7h for emacs-devel@gnu.org; Tue, 22 Nov 2022 14:28:53 -0500 Original-Received: by mail-pg1-x52e.google.com with SMTP id 62so14842992pgb.13 for ; Tue, 22 Nov 2022 11:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=EeJFs8QG6wHNzh4OFUyFK83t8o67GHpm8b1I+x9hGa8=; b=mYnh7+z3Joe74f9JDZ8I/tFQ5vgm5gqmDAz5GHDYRfR5Myo30i+4UU9NP34xJf+Cpx mlKq+4PJpbOMvZH8JHBA3n0RLgPFKXbWZN2/M7aLGmccM5lazGTF4HM5qGi8O6NRssjN /ARBPa9BjdJkyrLcCtQT1FEijqWka0co8Zob5cN6BYODylKmxitmK/qgmhclsEItdJeC uD8lmlX2aJVf4vnkJhHe4Ub6hzFFtlD6teNkiias9Rpc5d/M06/xqkpdPFYX+AAsamZ2 WSvZqxfd5XYITfGHy/vbu5S267ObH3fL0amviTOxGBeYFQRA7y7ar4wCaYONUzTCES+z +r7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=EeJFs8QG6wHNzh4OFUyFK83t8o67GHpm8b1I+x9hGa8=; b=fCIKfHWln6zLRpV8/ZMojsyC4J4zewPk+7TSY2eKSqIoAAcA7+ikUnYS4ZBJyF5MFr mNdQpcvNyk/htrK0XUNDzFJaLpChGaqto0acPJskmnH6mc6fvFsgrwXBoQXIpGld2Tx6 /4BzLCjEAGBRsB5lmLqibzMwTqp3HSk7v3RRk1FK2CZQ4eI6Hw7bnDKbu0gjtHdbuHEs ifgaA6SEWTvqDAPeplGvXIc/PjpDPGIeAnooEwr3ylwYbrpHxVq34M98bHPTJxma4bUR gjEHDVb/Mh1y6LKmLOxSbphp4IIl/ZsFn+DgPVyUjq2y2escNZRKlXMJtSoht6w6gZu+ 5qMw== X-Gm-Message-State: ANoB5pmpZ16fpNd6EhRbJiAqwmfwquQwHbGeVihfR3ViyNFonLGeTU14 V8PHMk+eo75N/MaJB0UuVQY= X-Google-Smtp-Source: AA0mqf62lmRYdyjenk062D1G+4XB51pHSwq4AMbzLDrsf+EGSSRoVMPbb74Pi9+Twzw3b5lT68SyPw== X-Received: by 2002:aa7:8f08:0:b0:56d:4d37:89dc with SMTP id x8-20020aa78f08000000b0056d4d3789dcmr6404687pfr.81.1669145330119; Tue, 22 Nov 2022 11:28:50 -0800 (PST) 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 d18-20020a63fd12000000b0043c22e926f8sm9478044pgh.84.2022.11.22.11.28.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2022 11:28:49 -0800 (PST) In-Reply-To: <87o7syaon6.fsf@gmail.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=casouri@gmail.com; helo=mail-pg1-x52e.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:300345 Archived-At: > On Nov 22, 2022, at 9:24 AM, Wilhelm wrote: >=20 > Is there perhaps an example using treesit-range-rules? To following > attempt to set treesit-range-settings does not seem to have the = desired > effect. >=20 > (defvar heex--treesit-range-rules > (treesit-range-rules > :embed 'elixir > :host 'heex > '((directive (partial_expression_value) @cap) > (directive (expression_value) @cap) > (expression (expression_value) @cap)))) >=20 > (setq-local treesit-range-settings heex--treesit-range-rules) >=20 > The following error also pops up when modifying the buffer when = removing > buffer content: >=20 > Error during redisplay: (jit-lock-function 1) signaled > (treesit-range-invalid "RANGE is either overlapping, out-of-order or > out-of-range" ((11 . 20))) >=20 > The full attempt is here: = https://github.com/wkirschbaum/elixir-mode/blob/main/heex-mode.el >=20 Thanks Wilhelm. It would be nice if you can provide some example source = file of heex for me to experiment with. I tried to find some on the = internet but didn=E2=80=99t get very far :-) Yuan