-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Improve UndefinedFunctionError for unqualified module #12859
Improve UndefinedFunctionError for unqualified module #12859
Conversation
This PR builds off of elixir-lang#12839, handling the case where a developer forgets to alias a module, resulting in UndefinedFunctionError. Imagine we have the following modules in our Elixir program. ```elixir def MyAppWeb.Context.Event do def foo, do: :bar end ``` If the developer attempts to reference this module, but forgets to type the alias, they will now get module suggestions like. ```elixir ** (UndefinedFunctionError) function Event.foo/0 is undefined (module Event is not available). Did you mean: * MyAppWeb.Context.Event.foo/0 Event.foo() iex:2: (file) ```
@josevalim updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 💜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastique 🥁
Thank you @davydog187. I think these heuristics will likely do a much better job than jaro_distance for modules. |
💚 💙 💜 💛 ❤️ |
This PR builds off of #12839, handling the case where a developer forgets to alias a module, resulting in UndefinedFunctionError.
Imagine we have the following modules in our Elixir program.
If the developer attempts to reference this module, but forgets to type the alias, they will now get module suggestions like.
TODO