Doom-emacs: Company-Mode not working in elixir/alchemist files

Created on 5 Feb 2018  Â·  15Comments  Â·  Source: hlissner/doom-emacs

Greetings,

running the most recent master branch company-mode seems not to work in alchemist-mode. Company-mode seems to be enabled. When i open a .ex-file for the first time, i get the error message Error (use-package): elixir-mode/:config: Wrong type argument: consp, nil.

Running macOS 10.12.16 with DOOM v2.0.9.

bug packages resolved

All 15 comments

Are you on develop or master?

I am on master. But i think there is in general something wrong with the alchemist-mode. Using the built-in REPL will often freeze emacs completely. For example i simply opened up a project REPL (alchemist-iex-project-run) changed my project code, and wanted to recompile alchemist-iex-reload-module which used the command r() and froze emacs.

Can you get out of it by pressing C-g (maybe multiple times)?

Unfortunately, I know little about Elixir, so I can't offer much insight. Perhaps this issue is relevant to https://github.com/tonini/alchemist.el/issues/326?

Can't replicate the issue at the moment. But i will do so later. Thanks for the linked issue!

Do you have any clue why company-mode doesn't work?

This PR fixed this issue. https://github.com/tonini/alchemist.el/pull/314

But alchemist.el seems to be inactive for a long time, so it hasn't got merged. I've been using this fork for some time, and it worked fine for me.

I haven't decided whether to put the fork in Doom or not, but in the meantime, something like this added to your private module's packages.el file should work:

(package! alchemist :recipe (:fetcher github :repo "whysoserious/alchemist.el" :branch "prevent-alchemist-iex-buffer-from-hanging"))

Do you have any clue why company-mode doesn't work?

I suspect that consp error is related to the smartparens config in lang/elixir. Could you comment out https://github.com/hlissner/doom-emacs/blob/master/modules/lang/elixir/config.el#L8-L14 and tell me if that resolves your issue?

I haven't decided whether to put the fork in Doom or not, but in the meantime, something like this added to your private module's packages.el file should work:

Will try this out, thanks!

I suspect that consp error is related to the smartparens config in lang/elixir. Could you comment out https://github.com/hlissner/doom-emacs/blob/master/modules/lang/elixir/config.el#L8-L14 and tell me if that resolves your issue?

Emacs will not start up probably with these lines commented out:

Warning (initialization): An error occurred while loading ‘/Users/marcel/.emacs.d/init.el’:

End of file during parsing: /Users/marcel/.emacs.d/modules/lang/elixir/config.el

That's because there's now a missing closing parenthesis. You'll need to comment those lines out and add a ) after them.

Sorry, missed that one.

Emacs loads up now fine, and i also don't get the Error (use-package): elixir-mode/:config: Wrong type argument: consp, nil displayed.

Autocomplete now works after pressing C-SPC but i think this is behaviour intented https://github.com/hlissner/doom-emacs/issues/77

Ah, that's what you meant. Yes, _auto_ completion is disabled by default. In master, you can develop it by adding this to your private module:

(require 'company)
(setq company-idle-delay 0.2)

On develop, you use completion/company's +auto module flag in your doom! block:

(doom! ... :completion (company +auto) ...)

Edit: Nvm. Got it working. Thank you :)

I've pushed a fix to develop. lang/elixir now uses my personal fork of alchemist.el that merges alchemist.el master with tonini/alchemist.el#314. This is temporary measure until that PR gets merged.

Hi,
After updating develop I have the following error:

No file named /home/marcel/.emacs.d/.local/packages/elpa/alchemist-20180219.937/alchemist-server/run.exs

@nresni Sorry about that, the quelpa recipe I was using was incomplete. I just fixed it. However, you'll need to delete alchemist manually for the fix to work:

rm -rf ~/.emacs.d/.local/packages/elpa/achemist-2*

Then run make in ~/.emacs.d to reinstall it.

Yes it works ! thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shuxiao9058 picture shuxiao9058  Â·  25Comments

ghost picture ghost  Â·  31Comments

Proziam picture Proziam  Â·  25Comments

HaoZeke picture HaoZeke  Â·  28Comments

Ptival picture Ptival  Â·  33Comments