Sarcasm / company-irony

company-mode completion back-end for irony-mode
118 stars 11 forks source link

Company irony doesn't work with irony 0.2 version #6

Closed zilongshanren closed 9 years ago

zilongshanren commented 9 years ago

When I input -> after a pointer, it just gives the following error:

irony--without-narrowing is a invalid function.

My emacs version is 24.4.

zilongshanren commented 9 years ago

The debug trace is as follows:

Debugger entered--Lisp error: (invalid-function irony-without-narrowing) irony-without-narrowing(17) irony-completion--send-request() irony-completion-candidates-async(#[0 "\302\300\301\"\207" ["" (closure ((backend . company-irony) (pt . 4390) (tick . 1382) (win . #<window 3 on CCNode.cpp>) (buf . #) (res) (c :async . #[257 "\301\302\303\304\305\306\300\"\307\"\310\311%!\207" ["" irony-completion-candidates-async make-byte-code 0 "\302\300\301\"\207" vconcat vector [company-irony--candidates-async] 3 "\n\n(fn)"] 9 "\n\n(fn CALLBACK)"]) (prefix . "") t) (candidates) (if (not (and candidates (eq res (quote done)))) (setq res candidates) (setq company-backend backend company-candidates-cache (list (cons prefix (company--process-candidates candidates)))) (company-idle-begin buf win tick pt))) company-irony--candidates-async] 3 "\n\n(fn)"])

[257 "\301\302\303\304\305\306\300\"\307\"\310\311%!\207" ["" irony-completion-candidates-async make-byte-code 0 "\302\300\301\"\207" vconcat vector [company-irony--candidates-async] 3 "\n\n(fn)"] 9 "\n\n(fn CALLBACK)"](%28closure %28%28backend . company-irony%29 %28pt . 4390%29 %28tick . 1382%29 %28win . #<window 3 on CCNode.cpp>%29 %28buf . #%29 %28res%29 %28c :async . #[257 "301302303304305306300"307"310311%!207" ["" irony-completion-candidates-async make-byte-code 0 "302300301"207" vconcat vector [company-irony--candidates-async] 3 "nn%28fn)"] 9 "\n\n(fn CALLBACK)"]) (prefix . "") t) (candidates) (if (not (and candidates (eq res (quote done)))) (setq res candidates) (setq company-backend backend company-candidates-cache (list (cons prefix (company--process-candidates candidates)))) (company-idle-begin buf win tick pt))))

funcall(#[257 "\301\302\303\304\305\306\300\"\307\"\310\311%!\207" ["" irony-completion-candidates-async make-byte-code 0 "\302\300\301\"\207" vconcat vector [company-irony--candidates-async] 3 "\n\n(fn)"] 9 "\n\n(fn CALLBACK)"](closure %28%28backend . company-irony%29 %28pt . 4390%29 %28tick . 1382%29 %28win . #<window 3 on CCNode.cpp>%29 %28buf . #%29 %28res%29 %28c :async . #[257 "301302303304305306300"307"310311%!207" ["" irony-completion-candidates-async make-byte-code 0 "302300301"207" vconcat vector [company-irony--candidates-async] 3 "nn%28fn)"] 9 "\n\n(fn CALLBACK)"]) (prefix . "") t) (candidates) (if (not (and candidates (eq res (quote done)))) (setq res candidates) (setq company-backend backend company-candidates-cache (list (cons prefix (company--process-candidates candidates)))) (company-idle-begin buf win tick pt)))) (let ((buf (current-buffer)) (win (selected-window)) (tick (buffer-chars-modified-tick)) (pt (point)) (backend company-backend)) (funcall (cdr c) (function (lambda (candidates) (if (not (and candidates (eq res ...))) (setq res candidates) (setq company-backend backend company-candidates-cache (list (cons prefix ...))) (company-idle-begin buf win tick pt)))))) (if (not (eq (car c) :async)) c (let ((buf (current-buffer)) (win (selected-window)) (tick (buffer-chars-modified-tick)) (pt (point)) (backend company-backend)) (funcall (cdr c) (function (lambda (candidates) (if (not (and candidates ...)) (setq res candidates) (setq company-backend backend company-candidates-cache (list ...)) (company-idle-begin buf win tick pt)))))) (or res (progn (setq res (quote done)) nil))) (let ((c (if company--manual-action (company-call-backend (quote candidates) prefix) (company-call-backend-raw (quote candidates) prefix))) res) (if (not (eq (car c) :async)) c (let ((buf (current-buffer)) (win (selected-window)) (tick (buffer-chars-modified-tick)) (pt (point)) (backend company-backend)) (funcall (cdr c) (function (lambda (candidates) (if (not ...) (setq res candidates) (setq company-backend backend company-candidates-cache ...) (company-idle-begin buf win tick pt)))))) (or res (progn (setq res (quote done)) nil)))) company--fetch-candidates("") (company--process-candidates (company--fetch-candidates prefix)) (setq candidates (company--process-candidates (company--fetch-candidates prefix))) (or candidates (if company-candidates-cache (progn (let ((len (length prefix)) (completion-ignore-case ignore-case) prev) (catch (quote --cl-block-nil--) (let ((--dotimes-limit-- ...) (--dotimes-counter-- 0)) (while (< --dotimes-counter-- --dotimes-limit--) (let ... ...) (setq --dotimes-counter-- ...))))))) (setq candidates (company--process-candidates (company--fetch-candidates prefix)))) (let ((candidates (cdr (assoc prefix company-candidates-cache))) (ignore-case (company-call-backend (quote ignore-case)))) (or candidates (if company-candidates-cache (progn (let ((len (length prefix)) (completion-ignore-case ignore-case) prev) (catch (quote --cl-block-nil--) (let (... ...) (while ... ... ...)))))) (setq candidates (company--process-candidates (company--fetch-candidates prefix)))) (setq candidates (company--transform-candidates candidates)) (if candidates (progn (if (or (cdr candidates) (not (eq t (compare-strings ... nil nil prefix nil nil ignore-case)))) candidates t)))) company-calculate-candidates("") (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not (consp c)) (if company--manual-action (progn (message "No completion found"))) (if company--manual-action (progn (setq company--manual-prefix prefix))) (if (symbolp backend) (setq company-lighter (concat " " (symbol-name backend))) (company--update-group-lighter (car c))) (company-update-candidates c) (run-hook-with-args (quote company-completion-started-hook) (company-explicit-action-p)) (company-call-frontends (quote show)))) (if (company--good-prefix-p prefix) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not (consp c)) (if company--manual-action (progn (message "No completion found"))) (if company--manual-action (progn (setq company--manual-prefix prefix))) (if (symbolp backend) (setq company-lighter (concat " " (symbol-name backend))) (company--update-group-lighter (car c))) (company-update-candidates c) (run-hook-with-args (quote company-completion-started-hook) (company-explicit-action-p)) (company-call-frontends (quote show))))) (progn (if (company--good-prefix-p prefix) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not (consp c)) (if company--manual-action (progn (message "No completion found"))) (if company--manual-action (progn (setq company--manual-prefix prefix))) (if (symbolp backend) (setq company-lighter (concat " " (symbol-name backend))) (company--update-group-lighter (car c))) (company-update-candidates c) (run-hook-with-args (quote company-completion-started-hook) (company-explicit-action-p)) (company-call-frontends (quote show))))) (throw (quote --cl-block-nil--) c)) (if prefix (progn (if (company--good-prefix-p prefix) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not (consp c)) (if company--manual-action (progn (message "No completion found"))) (if company--manual-action (progn (setq company--manual-prefix prefix))) (if (symbolp backend) (setq company-lighter (concat " " ...)) (company--update-group-lighter (car c))) (company-update-candidates c) (run-hook-with-args (quote company-completion-started-hook) (company-explicit-action-p)) (company-call-frontends (quote show))))) (throw (quote --cl-block-nil--) c))) (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (or (not (symbolp backend)) (eq t (get backend (quote company-init))) (if (get backend (quote company-init)) nil (company-init-backend backend))) (progn (funcall backend (quote prefix)))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not (consp c)) (if company--manual-action (progn ...)) (if company--manual-action (progn ...)) (if (symbolp backend) (setq company-lighter ...) (company--update-group-lighter ...)) (company-update-candidates c) (run-hook-with-args (quote company-completion-started-hook) (company-explicit-action-p)) (company-call-frontends (quote show))))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (or (not (symbolp backend)) (eq t (get backend ...)) (if (get backend ...) nil (company-init-backend backend))) (progn (funcall backend (quote prefix)))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) (if (not ...) (if company--manual-action ...) (if company--manual-action ...) (if ... ... ...) (company-update-candidates c) (run-hook-with-args ... ...) (company-call-frontends ...)))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (or (not ...) (eq t ...) (if ... nil ...)) (progn (funcall backend ...))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (setq company-prefix ... company-backend backend c ...) (if ... ... ... ... ... ... ...))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (or ... ... ...) (progn ...)) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn ... ...)) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (let (prefix c) (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or ... ...) (if ... ...) (company--multi-backend-adapter backend ...))) (if prefix (progn (if ... ...) (throw ... c))) (setq --dolist-tail-- (cdr --dolist-tail--))))))) company--begin-new() (and (company--should-complete) (company--begin-new)) (or (and company-candidates (company--continue)) (and (company--should-complete) (company--begin-new))) company--perform() (condition-case err (company--perform) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel))) (let ((company-idle-delay (quote now))) (condition-case err (company--perform) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel)))) (and company-mode (not company-candidates) (let ((company-idle-delay (quote now))) (condition-case err (company--perform) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel))))) company-auto-begin() (if (company-auto-begin) (progn (company-input-noop) (company-post-command))) (and (eq buf (current-buffer)) (eq win (selected-window)) (eq tick (buffer-chars-modified-tick)) (eq pos (point)) (if (company-auto-begin) (progn (company-input-noop) (company-post-command)))) company-idle-begin(# #<window 3 on CCNode.cpp> 1382 4390) apply(company-idle-begin (# #<window 3 on CCNode.cpp> 1382 4390)) byte-code("r\301\302H\303H\"\210)\301\207" [timer apply 5 6] 4) timer-event-handler([t 21752 31867 684492 nil company-idle-begin (# #<window 3 on CCNode.cpp> 1382 4390) nil 0])

Sarcasm commented 9 years ago

I'm not sure what's the issue here, company-irony doesn't use irony--without-narrowing directly, only irony does. Did you byte-compile company-irony with an older version of irony or something like that maybe? (I have no idea). Can you uninstall then reinstall both package?

zilongshanren commented 9 years ago

@Sarcasm I have reinstalled both packages and it still can't work. I will try to unload all packages I'm using and reinstall the irony and company-irony again.

Thanks.

zilongshanren commented 9 years ago

@Sarcasm I have tried a clean Emacs and it works well. Thanks for providing this awesome tool.

Sarcasm commented 9 years ago

Great,

I'm closing, I will keep this in mind if anyone complains about something similar.