dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

Wrong number of arguments when trying to complete method #108

Closed wvxvw closed 5 years ago

wvxvw commented 7 years ago
Debugger entered--Lisp error: (wrong-number-of-arguments #[(command &optional arg) "<bytecompiled code>" [command robe-mode robe-running arg spec wconfig eql interactive company-begin-backend company-robe prefix boundp company-grab-symbol candidates robe-complete-thing duplicates t meta robe-cached-specs robe-signature location company-robe-choose-spec 4 5 doc-buffer current-window-configuration #[nil "\301!\207" [wconfig set-window-configuration] 2] robe-show-doc message nil get-buffer "*robe-doc*"] 4 ("/home/olegs/.emacs.d/elpa/robe-0.7.7/robe-company.elc" . 410) (list (quote interactive))] 3)
  company-robe(pre-render #("!" 0 1 (face font-lock-function-name-face)) nil)
  apply(company-robe (pre-render #("!" 0 1 (face font-lock-function-name-face)) nil))
  company-call-backend-raw(pre-render #("!" 0 1 (face font-lock-function-name-face)) nil)
  apply(company-call-backend-raw (pre-render #("!" 0 1 (face font-lock-function-name-face)) nil))
  company--force-sync(company-call-backend-raw (pre-render #("!" 0 1 (face font-lock-function-name-face)) nil) company-robe)
  company-call-backend(pre-render #("!" 0 1 (face font-lock-function-name-face)) nil)
  company--pre-render(#("!" 0 1 (face font-lock-function-name-face)))
  company-fill-propertize(#("!" 0 1 (face font-lock-function-name-face)) nil 3 t " " " ")
  company--create-lines(0 10)
  company-pseudo-tooltip-show(23 17 0)
  company-pseudo-tooltip-show-at-point(597 0)
  company-pseudo-tooltip-frontend(post-command)
  company-pseudo-tooltip-unless-just-one-frontend(post-command)
  company-call-frontends(post-command)
  company-post-command()

I'll investigate further, but one thing I've already noticed: completion works, sort of, in *pry* buffer.

wvxvw commented 7 years ago

I made some modifications for the sake of debugging:

(defun company-robe (command &rest args)
  "A `company-mode' completion back-end for `robe-mode'."
  (interactive (list 'interactive))
  (message "command: %s, args: %s" command args)
  (let ((arg (car args)))
    (case command ... )))

And now I see that often times this function is given 3 arguments, contrary to the expected 2 arguments. With this change, the function seems to work.

dgutov commented 7 years ago

Why "expected 2 arguments", though?

Here is its current signature:

(defun company-robe (command &optional arg &rest ignore)
wvxvw commented 7 years ago

Well, that's what I've got from MELPA... Then, I'm guessing it must be fixed already.

dgutov commented 7 years ago

I kind of doubt that: even melpa-stable (EDIT: I've checked) contains this signature, for years now.

wvxvw commented 7 years ago

I've reinstalled it, maybe it pulled this version as dependency of something else... Now I'm having different errors. I'll investigate and open a different ticket if necessary.