From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#75191: [PATCH] Add expression handling to heex-ts-mode Date: Thu, 2 Jan 2025 01:44:35 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39221"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Yuan Fu To: Wilhelm Kirschbaum , 75191@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 08:45:35 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tTFte-000A2Z-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 08:45:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTFtB-00046y-5S; Thu, 02 Jan 2025 02:45:05 -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 1tTFt9-00045C-Rg for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:45:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTFt9-0007UV-IH for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:45:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=hglaXQwHVI7rkCq3N45F4P0OyWTRutXsyJiLObc704k=; b=fDZy8c7YE3Yy8Sa8zT/1Qp47HrrweTiQPLGVyvaowu4m6rwa6nA59nqHSeLN0VhEaaDlGgITaP68gP1rPb308CBIdWTBmYOkSQ+dJgBpLPlAtauK40sFAn9zqftWYVuiY2HAo6OER/ApKI8Ax0twde3Dxkl1YlZcDHQacWyN7piswoeWNStvnI5VYbUc2BXYs21mdptA69KMnYE4iy55mmPIxWyPq7iIsq+cBj2qIpcmEqkrWm4kGr3owZT7cV5JpPeV5MdcMYR9ZFUfOOV9p1aaEkxwyo7wmlGgkm9UzoochXxVCBiMDxgCj5U+uqOxTfyUuLMDPUyk5QgTYM0Oog==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTFt8-0001zQ-DT for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jan 2025 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75191 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75191-submit@debbugs.gnu.org id=B75191.17358038847612 (code B ref 75191); Thu, 02 Jan 2025 07:45:02 +0000 Original-Received: (at 75191) by debbugs.gnu.org; 2 Jan 2025 07:44:44 +0000 Original-Received: from localhost ([127.0.0.1]:42578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTFsq-0001yi-1e for submit@debbugs.gnu.org; Thu, 02 Jan 2025 02:44:44 -0500 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:48261) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTFso-0001yT-ES for 75191@debbugs.gnu.org; Thu, 02 Jan 2025 02:44:43 -0500 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d7e3f1fdafso22695927a12.0 for <75191@debbugs.gnu.org>; Wed, 01 Jan 2025 23:44:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735803876; x=1736408676; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=hglaXQwHVI7rkCq3N45F4P0OyWTRutXsyJiLObc704k=; b=W8qdboogcqoVetF5eGt0sJzL85kZuhrmiLzdLBHwa1fDxTi+QQTVXVVFE97VBDTPG+ mWN+21+hVk/VL6lg49TvPhNEgUwsaUA4BuL4xanaiDouzfM9vG5eEGFzx7doXpnFQe1L 2FEkQCAKCxQZu6jOtU1Azf5Ah7HdIolpweg7g8+8SdmQNKL3XeIoNRD72f7eVbjN9JDo dNJNerMxttQeirDPrTcoDms2ohUFo7ya5lj0kVrg4L32lKsqZ4YOEKb/YTb1T7qSpizz HiE8KOo6VC/Plbi0rZYIcHaNCm2vkMenzPsPT2hmvNSP5eTJ0REnmmszbTIhJYb2rcbG 4Q9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735803876; x=1736408676; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hglaXQwHVI7rkCq3N45F4P0OyWTRutXsyJiLObc704k=; b=nOPFf49pMyHGVT8Ja0QQBmW+DSKkVffUqTa6OGKWLjXxVS84OHxb+NAvEm7MJ8tNUp f/H774t3awri/zDelWlO0JOXfMT8j0lDqosdSmPNrwoON2p4cNggVtfhl6obUgMWZnAo Hg8lyWj4xSqpYrICXmAzVLe8Ufozdss+j1pgrMFo/Sfy4nw909zYqoElVE/7aGXn7K/e uU7OQzug+9YlnoHuZlO6Qmy9xgfkJu5XI5cmVBA67Jx5MvTDk31H/Bb1pQYzOf9O7gj6 4O2ROHWsjxCdEP9niCZIUEIVRo78bpcZAnCwOihfN3K85fayCThWwP+RGuzXxjqKkgAE WSnA== X-Forwarded-Encrypted: i=1; AJvYcCWhEI4EViP00Te9QcMavxKGRSPIhBLKTQmfvDxIYI98bYMl4jbveVU8hrwvR6AMLveuxbfFaA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyH95DPFoXMxVxGzGYH5H23qC7s5i/ujOgYc/s3ftG8gMOnIMuG NIsN7auo5sq31TGw1RjIOnaR0w8M+XiS1QLjLU5mMAkvBk5xASkDFWB04tCORLCDyRc6OGneXM/ KQucpv/zW4f+NVvBD/BP334Ca+zU= X-Gm-Gg: ASbGncvVHruR6gD4gXJQDJbwiWpPiWWdszt46GDs713AxwqVIc5eyNXBjCn9J7Fhe+b 7SyZryB7wW6M29lAG/Ac7KRxg0Cw+kJ3O3WS5G3bi X-Google-Smtp-Source: AGHT+IHuAXlZBMFcNP0Vg2MqqNezsIT87DdWfFc+CjMLJuBZYINQsk/P83ZHaPLrtI9MwUZfc7XnbwMJoDDgEeeEB9U= X-Received: by 2002:a05:6402:50d0:b0:5d1:1f1:a283 with SMTP id 4fb4d7f45d1cf-5d81dd849efmr37144958a12.4.1735803876177; Wed, 01 Jan 2025 23:44:36 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 2 Jan 2025 01:44:35 -0600 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298139 Archived-At: Wilhelm Kirschbaum writes: > This patch is to handle the recent update to the heex grammar: > https://github.com/phoenixframework/tree-sitter-heex/releases/tag/v0.7.0 > > This change appears to be backwards compatible. Looks safe enough for emacs-30? Eli, Yuan, WDYT? > From 7e1fd814d19e820a6b17d62ce4229ae1daaef5cf Mon Sep 17 00:00:00 2001 > From: Wilhelm Kirschbaum > Date: Mon, 30 Dec 2024 12:45:08 +0200 > Subject: [PATCH] Add expression handling to heex-ts-mode > > On the latest update of the grammar expressions were added and won't be > seen as directives anymore. > > * lisp/progmodes/heex-ts-mode.el > (heex-ts--sexp-regexp): Match on expression as well. > (heex-ts--indent-rules): Indent on expression end. > * test/lisp/progmodes/heex-ts-mode-resources/indent.erts: Add expression > indent test. > --- > lisp/progmodes/heex-ts-mode.el | 3 ++- > .../progmodes/heex-ts-mode-resources/indent.erts | 16 ++++++++++++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el > index b527d96b579..797bfd6c8ff 100644 > --- a/lisp/progmodes/heex-ts-mode.el > +++ b/lisp/progmodes/heex-ts-mode.el > @@ -54,7 +54,7 @@ heex-ts-indent-offset > (defconst heex-ts--sexp-regexp > (rx bol > (or "directive" "tag" "component" "slot" > - "attribute" "attribute_value" "quoted_attribute_value") > + "attribute" "attribute_value" "quoted_attribute_value" "expression") > eol)) > > ;; There seems to be no parent directive block for tree-sitter-heex, > @@ -81,6 +81,7 @@ heex-ts--indent-rules > ((node-is "end_slot") parent-bol 0) > ((node-is "/>") parent-bol 0) > ((node-is ">") parent-bol 0) > + ((node-is "}") parent-bol 0) > ((parent-is "comment") prev-adaptive-prefix 0) > ((parent-is "component") parent-bol ,offset) > ((parent-is "tag") parent-bol ,offset) > diff --git a/test/lisp/progmodes/heex-ts-mode-resources/indent.erts b/test/lisp/progmodes/heex-ts-mode-resources/indent.erts > index 500ddb2b536..7fef6571933 100644 > --- a/test/lisp/progmodes/heex-ts-mode-resources/indent.erts > +++ b/test/lisp/progmodes/heex-ts-mode-resources/indent.erts > @@ -45,3 +45,19 @@ Name: Slots > > > =-=-= > + > +Name: Expression > + > +=-= > +
> +{ > +@bar > +} > +
> +=-= > +
> + { > + @bar > + } > +
> +=-=-= > -- > 2.45.2