From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Newsgroups: gmane.emacs.devel Subject: Tree-sitter, using treesit-range-rules for embedded languages Date: Tue, 22 Nov 2022 19:24:13 +0200 Message-ID: <87o7syaon6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40230"; 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 Tue Nov 22 18:24:57 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 1oxX0z-000AGm-2b for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Nov 2022 18:24:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxX0Q-0004HA-EQ; Tue, 22 Nov 2022 12:24:22 -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 1oxX0P-0004GZ-7a for emacs-devel@gnu.org; Tue, 22 Nov 2022 12:24:21 -0500 Original-Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxX0N-0005O1-OQ for emacs-devel@gnu.org; Tue, 22 Nov 2022 12:24:20 -0500 Original-Received: by mail-wm1-x333.google.com with SMTP id t4so11211125wmj.5 for ; Tue, 22 Nov 2022 09:24:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=qtjDxHSR+fSIwVV7u/IC/OEJlG9e1g1XdgV42bhApfI=; b=NrFUaXHeOP7slfn78s//taIotyc8QhHxX94plgjhG5Qh1MSy1fx0WCIwnaPUOILB0P MG02SWqP6uMkITQ/H3kmoGX2lJdwBR1WyfEhqAr1iwXCxov5T5yuqzEpU1pZ+RnkqFxR QJ37eoLA9vqX8tbtoivZQDY3wBULoO1FOx/mdc5V613wMf+3vk0TmuRlHf2OaqMq1nNZ j4eBcC5sw4PXhX4HAqRoMZvkEy7UuIpWXlTgWLZIdbBeE5b1mMYgJMuB27vLqWAnWVPi hJaTWfApqMcMg1muv8ymvNqWYJhBM5/Dz69E3w0zP6bRRiXDtPVcSYoDGF3MQIYm7sc3 jh8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qtjDxHSR+fSIwVV7u/IC/OEJlG9e1g1XdgV42bhApfI=; b=XyVkZMnC4JM45PnuMOEL4IoCjz1KVXW1Wp5abdx3NXoBthjOP8cEMICJyzzv9SAlXn XBniSdnkri5sA01TNxxk2Kvg34TTStOFEhHjkWcHGmhvTxcCh1JU6W+VTSYCx4Gmchn+ qA+biQR95PznG5ZtZ/R71hrXsopGV1GT02J+/cFNV1atDjq9KI8dOThHMeMEiI/HwXGj s5+M6JnxcIxVzPsxxmjQ+KpsLSgl977EcV3dnga4wQt7D0IBEJB1wpcAoafgoEN2AN2X jOITYUtVwozMfxatL6/QCcxEzhDMBJTg3KkzEvMjly8ddtLlV+ba+jLsvIL8+F82+UED K9Og== X-Gm-Message-State: ANoB5pkl9iybRquiFnieadlwAqoPGiH89UAfHsKR5cK9MqunkeDMEm1B xPsHR2GTdHEs1HAUJ8W3CyAcdM+j5xc= X-Google-Smtp-Source: AA0mqf7XGr7D/4z27L7EDfBjUE2pvXjETxxzjnzR34G2oM8nXLgXUcCA1WmnlPbI4Y8P9Sqvh3A2dQ== X-Received: by 2002:a05:600c:3ba1:b0:3d0:47c:9ff5 with SMTP id n33-20020a05600c3ba100b003d0047c9ff5mr10414521wms.121.1669137856859; Tue, 22 Nov 2022 09:24:16 -0800 (PST) Original-Received: from melissa.local ([102.135.241.76]) by smtp.gmail.com with ESMTPSA id v3-20020a1cf703000000b003cf774c31a0sm20601318wmh.16.2022.11.22.09.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 09:24:16 -0800 (PST) Original-Received: by melissa.local (Postfix, from userid 1000) id E08AE421742; Tue, 22 Nov 2022 19:24:13 +0200 (SAST) Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=wkirschbaum@gmail.com; helo=mail-wm1-x333.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:300340 Archived-At: 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. (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)))) (setq-local treesit-range-settings heex--treesit-range-rules) The following error also pops up when modifying the buffer when removing buffer content: Error during redisplay: (jit-lock-function 1) signaled (treesit-range-invalid "RANGE is either overlapping, out-of-order or out-of-range" ((11 . 20))) The full attempt is here: https://github.com/wkirschbaum/elixir-mode/blob/main/heex-mode.el