racer-rust / emacs-racer

Racer support for Emacs
399 stars 48 forks source link

eldoc error: (void-variable exit-code) when trying to use emacs-racer #73

Closed kinnison closed 7 years ago

kinnison commented 7 years ago

Hi,

I tried to install emacs-racer using the instructions. Once installed, it loads, but for some reason it is unable to document or complete anything. As an example, here is a traceback:

Debugger entered--Lisp error: (void-variable exit-code)
  racer--call("complete" "1" "5" "/home/dsilvers/dev-rust/foo.rs" "/tmp/racer24459EKC")
  racer--call-at-point("complete")
  racer-complete()
  racer-eldoc()
  #[0 "\302 \204\205G\303\304!\210\304\207  \203\303   !\207\305 \306 \211\204$\304\202B@=\2038\307\310\"\206B\311!\202B\311!\206B\307\310\"\303!\266\203\207" [eldoc-last-message eldoc-documentation-function eldoc-display-message-p eldoc-message nil eldoc-current-symbol eldoc-fnsym-in-current-sexp apply eldoc-get-fnsym-args-string eldoc-get-var-docstring] 5 "\n\n(fn)"]()
  funcall(#[0 "\302 \204\205G\303\304!\210\304\207  \203\303   !\207\305 \306 \211\204$\304\202B@=\2038\307\310\"\206B\311!\202B\311!\206B\307\310\"\303!\266\203\207" [eldoc-last-message eldoc-documentation-function eldoc-display-message-p eldoc-message nil eldoc-current-symbol eldoc-fnsym-in-current-sexp apply eldoc-get-fnsym-args-string eldoc-get-var-docstring] 5 "\n\n(fn)"])
  eldoc-print-current-symbol-info()
  #[0 "\205\301 \207" [eldoc-mode eldoc-print-current-symbol-info] 1 "\n\n(fn)"]()
  apply(#[0 "\205\301 \207" [eldoc-mode eldoc-print-current-symbol-info] 1 "\n\n(fn)"] nil)
  byte-code("r\301\302H\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 0 500000 t #[0 "\205\301 \207" [eldoc-mode eldoc-print-current-symbol-info] 1 "\n\n(fn)"] nil idle 0])

For reference, I am using Emacs 24.4.1 on Debian

Wilfred commented 7 years ago

Does M-x racer-debug show anything?

Wilfred commented 7 years ago

Looking at racer-call, we bind exit-code using -let, which is a macro defined in dash.el. Do you have dash installed? What version?

kinnison commented 7 years ago

racer-debug gives an error (racer-debug: Symbol's function definition is void: -drop-last) and an empty buffer.

I will admit that I expected appropriate dependencies to be dragged in and auto-loaded as necessary by default, but examining ~/.emacs.d I see dash-20161121.55/ which appears to contain a dash.el whose version claims to be 2.13.0

kinnison commented 7 years ago

Good news (ish) - I found an old dash.el squirrelled away somewhere emacs must have found it before loading the one in ~/.emacs.d sadly that hasn't fixed the eldoc error but it has enabled racer-debug to show me:

The last racer command was:

$ cd nil
$ export nil
$ export nil
$ nil 

This command terminated with exit code nil.

No output on stdout.

No output on stderr.

The temporary file will have been deleted. You should be
able to reproduce the same output from racer with the
following command:

$ nil nil nil 

Please report bugs on GitHub.

Which is depressingly unuseful :-(

For reference, if I put debug-on-error on, I still see racer--call("complete" "1" "9" "/tmp/foo.rs" "/tmp/racer274024qa") as the last thing in the backtrace.

Wilfred commented 7 years ago

I imagine that your racer.elc was produced with the old dash.el. Try deleting the .elc file.

kinnison commented 7 years ago

That has done the trick, thank you so much and I apologise for the noise.