Subject: bug#62327: [PATCH] Minor additions for heex- and elixir-ts-mode

From: Wilhelm Kirschbaum <[email-masked]>
Date: Tue, 21 Mar 2023 12:52:39 +0200

The first patch set heex-ts-mode to use the same language server 
as
elixir-ts-mode. The second adds a test to make it easier for 
detecting
breaking change to HEEx embeds.

>From 12ab3a29000f55e4b77e10602f47702c907a43ea Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <[email-masked]>
Date: Tue, 21 Mar 2023 11:48:30 +0200
Subject: [PATCH 1/2] Add heex-ts-mode to eglot-server-programs

The same language server is used for elixir and heex modes.

* lisp/progmodes/eglot.el (eglot-server-programs): Add heex-ts-mode.
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index fe9bc510049..cae5e038f11 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -221,7 +221,7 @@ eglot-server-programs
                                 ((java-mode java-ts-mode) . ("jdtls"))
                                 (dart-mode . ("dart" "language-server"
                                               "--client-id" "emacs.eglot-dart"))
-                                ((elixir-ts-mode elixir-mode) . ("language_server.sh"))
+                                ((elixir-mode elixir-ts-mode heex-ts-mode) . ("language_server.sh"))
                                 (ada-mode . ("ada_language_server"))
                                 (scala-mode . ,(eglot-alternatives
                                                 '("metals" "metals-emacs")))
-- 
2.40.0

>From b42d8a10124a83d39248bef31ffbb12efd04db0b Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <[email-masked]>
Date: Tue, 21 Mar 2023 12:13:58 +0200
Subject: [PATCH 2/2] ; Add test for embedded HEEx to elixir-ts-mode-tests

* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts:
Add test.
---
 .../elixir-ts-mode-resources/indent.erts      | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
index 748455cc3f2..ea5d9e62240 100644
--- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
@@ -306,3 +306,27 @@ Name: Long tuple
 {"January", "February", "March", "April", "May", "June", "July", "August", "September",
  "October", "November", "December"}
 =-=-=
+
+Name: Embedded HEEx
+
+=-=
+ defmodule Foo do
+ def foo(assigns) do
+~H"""
+<span>
+text
+</span>
+"""
+ end
+ end
+=-=
+defmodule Foo do
+  def foo(assigns) do
+    ~H"""
+    <span>
+      text
+    </span>
+    """
+  end
+end
+=-=-=
-- 
2.40.0