Skip to content

Instantly share code, notes, and snippets.

@tehprofessor
Created January 23, 2020 01:27
Show Gist options
  • Save tehprofessor/278b0236b299ad125ed385e27c619c01 to your computer and use it in GitHub Desktop.
Save tehprofessor/278b0236b299ad125ed385e27c619c01 to your computer and use it in GitHub Desktop.
iex autocomplete issue/question

Issue

When you try to autocomplete a module but have incorrectly capitalized it, it outputs an error to the console, e.g.

iex(2)> EFfDB.
17:09:28.708 [error] Loading of _build/dev/lib/eff_db/ebin/Elixir.EFfDB.beam failed: :badfile

When the module doesn't exist, no error is logged to the console. The issue isn't with IEx it's only manifesting there, it's with erlang and :code.

Question

Is this annoying to anyone else, is this a known issue with :code that won't be fixed, or am I just complaining about nothing?

Proposed Solutions

  1. Render nothing to the console. I personally would prefer this, because I think the error message is hard to understand, and if you're getting it for the first time, you probably aren't going to see your mistake making in the message, making it seem like you have a corrupted file and not a programmer issue. Seeing nothing predict just tells me it's not found at all, and I must have mistyped something.

  2. Render a more helpful error, example:

[error] File found, but module names do not match: EFfDB given, found Effdb in: ...EffDB.beam

  1. Something else?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment