From ad0818ec978a6f4d82622481a039819281e3fd0a Mon Sep 17 00:00:00 2001 From: Matt Furden Date: Fri, 5 May 2023 12:59:02 -0700 Subject: [PATCH 1/2] Add leex/heex to projectionist --- lua/elixir/projectionist/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/elixir/projectionist/init.lua b/lua/elixir/projectionist/init.lua index 993b2de6..8034ae79 100644 --- a/lua/elixir/projectionist/init.lua +++ b/lua/elixir/projectionist/init.lua @@ -102,6 +102,20 @@ local config = { "end", }, }, + ["lib/**/live/*_live.html.leex"] = { + type = "leex", + alternate = "test/{dirname}/live/{basename}_live_test.exs", + template = { + "", + }, + }, + ["lib/**/live/*_live.html.heex"] = { + type = "heex", + alternate = "test/{dirname}/live/{basename}_live_test.exs", + template = { + "", + }, + }, ["lib/**/channels/*_channel.ex"] = { type = "channel", alternate = "test/{dirname}/channels/{basename}_channel_test.exs", From 50f38a491031653358f6a307112d9fbd9b85644e Mon Sep 17 00:00:00 2001 From: Matt Furden Date: Fri, 5 May 2023 14:13:28 -0700 Subject: [PATCH 2/2] Remove forced _live convention from LiveView/Heex/Leex --- lua/elixir/projectionist/init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lua/elixir/projectionist/init.lua b/lua/elixir/projectionist/init.lua index 8034ae79..1aa21d2f 100644 --- a/lua/elixir/projectionist/init.lua +++ b/lua/elixir/projectionist/init.lua @@ -82,36 +82,36 @@ local config = { "end", }, }, - ["lib/**/live/*_live.ex"] = { + ["lib/**/live/*.ex"] = { type = "liveview", - alternate = "test/{dirname}/live/{basename}_live_test.exs", + alternate = "test/{dirname}/live/{basename}_test.exs", template = { - "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}Live do", + "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize} do", " use {dirname|camelcase|capitalize}, :live_view", "end", }, }, - ["test/**/live/*_live_test.exs"] = { + ["test/**/live/*_test.exs"] = { type = "test", - alternate = "lib/{dirname}/live/{basename}_live.ex", + alternate = "lib/{dirname}/live/{basename}.ex", template = { - "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}LiveTest do", + "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}Test do", " use {dirname|camelcase|capitalize}.ConnCase", "", " import Phoenix.LiveViewTest", "end", }, }, - ["lib/**/live/*_live.html.leex"] = { + ["lib/**/live/*.html.leex"] = { type = "leex", - alternate = "test/{dirname}/live/{basename}_live_test.exs", + alternate = "test/{dirname}/live/{basename}_test.exs", template = { "", }, }, - ["lib/**/live/*_live.html.heex"] = { + ["lib/**/live/*.html.heex"] = { type = "heex", - alternate = "test/{dirname}/live/{basename}_live_test.exs", + alternate = "test/{dirname}/live/{basename}_test.exs", template = { "", },