-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miskeeping a end
keyword in the context module while expanding it with mix phx.gen.context
#5697
Comments
Hi @GuillaumeMilan, I tried to reproduce this issue with Elixir 1.7.11 and I couldn't. ❯ cat lib/foo/my_test_context.ex
defmodule 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! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: