You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running the following context generation command:
mix phx.gen.context MySuperContext Datum data
The generated context consider the end of the module is belonging to the function and so it starts generating the context after it
defmoduleMyApp.MySuperContextdodefalready_present_fun,do: "hello world!"end# <- this end is staying during the generationaliasMyApp.MySuperContext.Datum....end
Expected behavior
The end keyword should be correctly considered as the end of the module and be removed during the generation of the context's functions
I tried to reproduce this issue with Elixir 1.7.11 and I couldn't.
❯ cat lib/foo/my_test_context.exdefmodule Foo.MyTestContext do def already_present_fun, do: "hello world!"end
❯ mix phx.gen.context MyTestContext Datum data You are generating into an existing context....Would you like to proceed? [Yn] y...
❯ head lib/foo/my_test_context.ex defmodule Foo.MyTestContext do def already_present_fun, do: "hello world!" alias Foo.MyTestContext.Datum @doc """ Returns the list of data. ## Examples
Did you try with any other version? Maybe it's already fixed or maybe I am testing it wrong, please let me know!
Environment
Erlang version: Erlang/OTP 26
Elixir version (elixir -v): Elixir 1.15.7 (compiled with Erlang/OTP 24)
Operating system: Mac OS Sonoma 14.2.1
Phoenix version in mix.exs
Actual behavior
Let’s say my context module is already existing as follow before running any
mix
command in my project:After running the following context generation command:
mix phx.gen.context MySuperContext Datum data
The generated context consider the end of the module is belonging to the function and so it starts generating the context after it
Expected behavior
The
end
keyword should be correctly considered as the end of the module and be removed during the generation of the context's functionsHere I was expecting something like this
The text was updated successfully, but these errors were encountered: