wende / autocomplete-elixir

Intelligent Elixir autocompletion provider for Atom autocomplete-plus
MIT License
42 stars 11 forks source link

fails to autocomplete popup at all and logs an error #26

Closed brainlid closed 8 years ago

brainlid commented 8 years ago

System: Arch Linux Elixir version: 1.1.1 Atom: 1.0.19 The beam.smp process is running but stays at 0% CPU.

There is an error when attempting to open the autocomplete at all. With Atom editing an Elixir mix project and the following file...

defmodule TestingMixBuilds do
  def something do
    IO.puts "howdy"
  end
end

With the cursor on "IO.p" and pressing ctrl+space, no autocomplete is displayed. Opening the Atom Developer Tools, this is the error...

CLOSED 1, Last Error: ** (UndefinedFunctionError) undefined function: nil.current_env/0
    nil.current_env()
    lib/iex/autocomplete.ex:172: IEx.Autocomplete.env_aliases/0
    lib/iex/autocomplete.ex:159: IEx.Autocomplete.expand_alias/1
    lib/iex/autocomplete.ex:145: IEx.Autocomplete.expand_elixir_modules/2
    /home/mark/.atom/packages/autocomplete-elixir/lib/alchemide/autocompleter/autocomplete.exs:104: anonymous fn/5 in :elixir_compiler_0.__FILE__/1
    /home/mark/.atom/packages/autocomplete-elixir/lib/alchemide/autocompleter/autocomplete.exs:118: anonymous fn/3 in :elixir_compiler_0.__FILE__/1

The autocomplete feature currently doesn't work at all for me. Would love to get it working. :)

wende commented 8 years ago

Hello. Have You got autocomplete-plus installed?

brainlid commented 8 years ago

Yes. I previously checked all the requirements.

gunnarhelgason commented 8 years ago

I have the same issue when using Elixir 1.1.1. Seems to work fine with Elixir 1.0.5, though.

Psvensso commented 8 years ago

Ref: https://github.com/elixir-lang/elixir/commit/5e21d0d22dbbd55ff603763a31afe21885c12658

Go to your ~/.atom/packages/autocomplete-elixir/lib/alchemide/autocompleter/autocomplete.exs

and add the autocomplete_server env var on the top.

Application.put_env(:iex, :autocomplete_server, IEx.Server)

Restart atom and your good to go.

brainlid commented 8 years ago

Thanks! That works great. Any chance you'll do a new release within the next week or so? I'm speaking at an Elixir meetup and wanted to include a highlight of your package. :)

fourcube commented 8 years ago

Thanks quickly providing a fix.

+1 for a bugfix release.