wende / autocomplete-elixir

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

error "Erlang home configuration setting missing", autocomplete doesn't work #30

Closed brainlid closed 8 years ago

brainlid commented 8 years ago

The error message "Erlang home configuration setting missing" is displayed when just saving an .html file. When launching the autocomplete in an elixir file, the error is also displayed.

Error is here...

exports.getAutocompletion = (prefix, cb) ->
  unless inp then exports.init(projectPaths)
  if prefix.trim().length < 1
    cb()
    return
  cmd = if IS_ELIXIR then "a" else "ea"
  # !! error is here, "inp" is undefined
  inp.write "#{cmd} #{prefix}\n"
  waitTillEnd (chunk) ->
    [_, one, multi] = chunk.split("<>")
    cb({one, multi: multi.split(";").filter((a) -> a.trim())})

Atom Version: 1.0.19 System: "Arch Linux" Elixir: 1.1.1 autocomplete-elixir: 1.4.2 Thrown From: autocomplete-elixir package, v1.4.2

Stack Trace

Uncaught TypeError: Cannot read property 'write' of null

At /usr/share/atom/resources/app.asar/src/pane.js:809

TypeError: Cannot read property 'write' of null
    at Object.exports.loadFile (/home/mark/.atom/packages/autocomplete-elixir/lib/alchemide/wrapper.coffee:70:6)
    at /home/mark/.atom/packages/autocomplete-elixir/lib/autocomplete-elixir-client.coffee:21:31
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
    at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1037:20)
    at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1004:19)
    at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app.asar/src/text-editor.js:584:26)
    at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app.asar/src/pane.js:547:18)
    at Object.module.exports.autosavePaneItem (/usr/share/atom/resources/app.asar/node_modules/autosave/lib/autosave.js:64:21)
    at /usr/share/atom/resources/app.asar/node_modules/autosave/lib/autosave.js:29:26

Commands

     -0:06.9.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:04.9.0 autocomplete-plus:activate (atom-text-editor.editor.is-focused)
     -0:02.6.0 window:toggle-dev-tools (atom-text-editor.editor.is-focused)

Config

{
  "core": {},
  "autocomplete-elixir": {}
}

Installed Packages

# User
autocomplete-elixir, v1.4.2
color-picker, v2.0.13
git-log, v0.4.1
iex, v0.9.18
language-elixir, v0.5.2
language-elm, v1.2.0
language-haml, v0.23.4
linter, v1.9.1
linter-elm-make, v0.3.0
linter-sass-lint, v0.4.1
minimap, v4.15.0
minimap-git-diff, v4.1.8
tree-view-git-status, v0.2.2

# Dev
No dev packages
hglman commented 8 years ago

Getting the same message when saving a file.

Anonyfox commented 8 years ago

me too

jarroput commented 8 years ago

Same here

wende commented 8 years ago

It seems that new atom update has changed a lot and the plugin isn't working as it should be. I'll take a look at it in free time.

Thanks for a good call guys! On 29 Oct 2015 18:32, "Jarro Put" notifications@github.com wrote:

Same here

— Reply to this email directly or view it on GitHub https://github.com/wende/autocomplete-elixir/issues/30#issuecomment-152258702 .

ghost commented 8 years ago

Have the same issue on Windows 10

jsribeiro commented 8 years ago

Have the same problem here... Confirm that a clean install starts failing after updating to 1.1.0.

I notice that the erl.exe process (I'm using Windows 8.1) starts using a lot of CPU for a few seconds at program start, and when I quit Atom, the erl.exe process remains running, I have to kill it by force.

brainlid commented 8 years ago

@wende I'm still new-ish to Elixir and Atom, but I'd be happy to help fix this if there is something I can do to help. I'm impressed and happy with your project. I'd love to be able to use it again.

manusajith commented 8 years ago

facing the same issue here.

dhrrgn commented 8 years ago

The issue is really just a documentation issue. Open your config and add this under "*":

  "autocomplete-elixir":
    erlangHome: "/usr/local/bin"
    elixirPath: "/usr/local/bin"

Note: Change the paths to where erlang and elixir are installed on your system

brainlid commented 8 years ago

I can confirm that this fixes it for me.

This can be set through the autocomplete-elixir package's settings. Initially I put in a full path to the binary (not a folder). There were no visible errors. When I opened Atom's Developer Tools, I saw errors flying by about the path I gave it not being a directory.

For my Arch Linux system, the correct paths for both are "/usr/bin".

Then it all works.

So I think the "fix" could be two things, a documentation update and possibly some UI showing an error if the directory provided isn't a directory.

smithaitufe commented 8 years ago

I tried the suggestion. I modified the config.json file in atom setting to this

"autocomplete-elixir": erlangHome: "C:\Program Files\erl7.0\bin" elixirPath: "C:\Program Files(x86)\elixir\bin"

but atom kept crashing. I could not work with it so I had to remove the lines completely.

The error message is still popping up.

Please look at this and offer practical suggestions. I really appreciate

davidmoshal commented 8 years ago

this worked for me (OSX, elixir installed with homebrew): Open Config, changed:

  "autocomplete-elixir":{}

to:

  "autocomplete-elixir":
    erlangHome: "/usr/local/bin"
    elixirPath: "/usr/local/bin"
zackify commented 8 years ago

@davidmoshal thanks!

aeamaea commented 8 years ago

For newcomers to atom/elixir like me, select the atom package named "Autocomplete Elixir" and scroll down, you'll see the Elixir Path and Erlang Home listed there. add /usr/bin or /usr/local/bin as per your settings (I'm using OSX)

potterdai commented 8 years ago

I have the exact problem happenning @smithaitufe

smithaitufe commented 8 years ago

I was able to resolve it later by using this

"autocomplete-elixir": erlangHome: "C:/Program Files/erl7.0/bin" elixirPath: "C:/Program Files (x86)/elixir/bin"

That is if you are using Windows. It help me. Make sure those paths are in your system environment path variable. Will be waiting for your response

potterdai commented 8 years ago

Thank you! @smithaitufe I tried, and it's constantly crashing... How did you solve the crashing problem?

smithaitufe commented 8 years ago

@potterdai: remember to restart atom. It worked for me. In fact, I am enjoying the autocomplete.

smithaitufe commented 8 years ago

@potterdai: remember to indent the last two lines that sets the paths for erlang and elixir and be sure that erlang and elixir are installed in that very location. Sorry for the stress. Do get back to me

potterdai commented 8 years ago

@smithaitufe not sure why but after reboot my laptop it worked! Thank you very much! = )

smithaitufe commented 8 years ago

@potterdai:I am glad you got it solved. Enjoy elixir.

18thletter commented 8 years ago

@davidmoshal That worked for me. Thank you!

simonh1000 commented 8 years ago

What file specifically needs to be changed in Ubuntu? I can't find any in .config/atom that refer to elixir and I have installed the plugin and get the errors others above report

18thletter commented 8 years ago

@simonh1000 Mine was in ~/.atom/config.cson.

yourpalal commented 8 years ago

I found the correct folders by running

    dirname `which erl`

So maybe this could be incorporated as a method of autodetecting where erlang is when the configuration is absent?