Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Error while trying to auto-complete via ac-cider #30

Open
prateekbhatt opened this issue Dec 17, 2015 · 5 comments
Open

Error while trying to auto-complete via ac-cider #30

prateekbhatt opened this issue Dec 17, 2015 · 5 comments

Comments

@prateekbhatt
Copy link

I am trying to setup ac-cider and have added the following to init.el :

(require 'ac-cider)
(add-hook 'cider-mode-hook 'ac-flyspell-workaround)
(add-hook 'cider-mode-hook 'ac-cider-setup)
(add-hook 'cider-repl-mode-hook 'ac-cider-setup)
(eval-after-load "auto-complete"
  '(progn
     (add-to-list 'ac-modes 'cider-mode)
     (add-to-list 'ac-modes 'cider-repl-mode)))

However, while typing any symbol, I get the error (e.g. while typing remo):

Company: backend company-capf error "Not a nREPL dict object: remove" with args (candidates remo)

Full error stack:

Debugger entered--Lisp error: (error "Not a nREPL dict object: rem")
  signal(error ("Not a nREPL dict object: rem"))
  error("Not a nREPL dict object: %s" "rem")
  nrepl-dict-get("rem" "candidate")
  cider-completion--parse-candidate-map("rem")
  mapcar(cider-completion--parse-candidate-map ("rem" "remove" "remove-ns" "re-matcher" "re-matches" "reset-meta!" "remove-watch" "remove-method" "ref-max-history" "ref-min-history\
" "remove-stopwords" "remove-all-methods"))
  cider-complete("rem")
  #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [cider-complete nil boundaries metadata mi\
nibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"]("rem" nil t)
  all-completions("rem" #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [cider-complete nil \
boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
  completion-pcm--all-completions("" ("rem" point) #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$\
)\207" [cider-complete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
  completion-basic-all-completions("rem" #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [ci\
der-complete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil 3)
  #[257 "\300^A^M\2368\301\242\302\242\303\304\242$\207" [2 ("rem") (#[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\
\307^A\300^E!^E^E$)\207" [cider-complete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"]) nil \
(3) completion-styles-alist] 6 "\n\n(fn STYLE)"](basic)
  completion--some(#[257 "\300^A^M\2368\301\242\302\242\303\304\242$\207" [2 ("rem") (#[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\2\
02&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [cider-complete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRE\
D ACTION)"]) nil (3) completion-styles-alist] 6 "\n\n(fn STYLE)"] (basic partial-completion emacs22))
  completion--nth-completion(2 "rem" #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [cider-\
complete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil 3 nil)
  completion-all-completions("rem" #[771 "\211\242\302=\206\n^@\211\303=?\2053^@r\301\204^W^@p\202(^@\304 \305^A!\203%^@\306^A!\202&^@p\262^Aq\210\307^A\300^E!^E^E$)\207" [cider-co\
mplete nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil 3)
  company-capf(candidates "rem")
  apply(company-capf (candidates "rem"))
  company-call-backend-raw(candidates "rem")
  company--fetch-candidates("rem")
  company-calculate-candidates("rem")
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer *cider-repl sparkling-getting-started*> #<window 12 on *cider-repl sparkling-getting-started*> 57 436)
  apply(company-idle-begin (#<buffer *cider-repl sparkling-getting-started*> #<window 12 on *cider-repl sparkling-getting-started*> 57 436))
  timer-event-handler([t 22130 52919 416324 nil company-idle-begin (#<buffer *cider-repl sparkling-getting-started*> #<window 12 on *cider-repl sparkling-getting-started*> 57 436) \
nil 0])

Specs:

CIDER 0.10.0 (package: 20151204.303)
Mac OSX 10.11
GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C1514)) of 2015-04-11

@alexander-yakushev
Copy link
Member

I have a suspicion it is Emacs25-related. Unfortunately I don't plan to look into Emacs25 compatibility until it hits at least a few major repos.

@prateekbhatt
Copy link
Author

Ok, thanks.

@arichiardi
Copy link

I get this error as well with latest cider 0.15.0-SNAPSHOT and emacs 24.5.1.

Debugger entered--Lisp error: (error "Not an nREPL dict object: ./sh")
  signal(error ("Not an nREPL dict object: ./sh"))
  error("Not an nREPL dict object: %s" "./sh")
  nrepl-dict-get("./sh" "candidate")
  cider-completion--parse-candidate-map("./sh")
  mapcar(cider-completion--parse-candidate-map ("./sh" "./dir" "./doc" "./pst" "./pprint" "./source" "./apropos" "./demunge" "./find-doc" "./root-cause" "./thread-stopper" "./stack-element-str" "./set-break-handler!"))
  cider-complete("./")
  (ac-cider-prepare-candidates (cider-complete ac-prefix))
  (progn (ac-cider-prepare-candidates (cider-complete ac-prefix)))
  (if (cider-connected-p) (progn (ac-cider-prepare-candidates (cider-complete ac-prefix))))
  ac-cider-candidates-everything()
  funcall(ac-cider-candidates-everything)
  (cond ((functionp function) (funcall function)) (t (eval function)))
  (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))
  (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function)))))
  (if cache nil (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))) (setq candidates (mapcar (function (lambda (candidate) (if (consp candidate) (propertize (car candidate) (quote value) (cdr candidate)) candidate))) candidates)) (if do-cache (progn (setq ac-candidates-cache (cons (cons source candidates) ac-candidates-cache)))))
  (let* ((do-cache (assq (quote cache) source)) (function (assoc-default (quote candidates) source)) (action (assoc-default (quote action) source)) (document (assoc-default (quote document) source)) (symbol (assoc-default (quote symbol) source)) (ac-limit (or (assoc-default (quote limit) source) ac-limit)) (face (or (assoc-default (quote face) source) (assoc-default (quote candidate-face) source))) (selection-face (assoc-default (quote selection-face) source)) (cache (and do-cache (assq source ac-candidates-cache))) (candidates (cdr cache))) (if cache nil (setq candidates (save-excursion (cond ((functionp function) (funcall function)) (t (eval function))))) (setq candidates (mapcar (function (lambda (candidate) (if (consp candidate) (propertize ... ... ...) candidate))) candidates)) (if do-cache (progn (setq ac-candidates-cache (cons (cons source candidates) ac-candidates-cache))))) (setq candidates (funcall (or (assoc-default (quote match) source) ac-match-function) ac-prefix candidates)) (if (and (integerp ac-limit) (> ac-limit 1) (> (length candidates) ac-limit)) (setcdr (nthcdr (1- ac-limit) candidates) nil)) (setq candidates (mapcar (function (lambda (candidate) (popup-item-propertize candidate (quote action) action (quote symbol) symbol (quote document) document (quote popup-face) face (quote selection-face) selection-face))) candidates)) candidates)
  ac-candidates-1(((candidates . ac-cider-candidates-everything) (symbol . "v") (available . ac-cider-available-p) (candidate-face . ac-cider-candidate-face) (selection-face . ac-cider-selection-face) (prefix . cider-completion-symbol-start-pos) (match . ac-cider-match-fuzzy) (document . ac-cider-documentation) (cache)))
  (append candidates (ac-candidates-1 source))
  (setq candidates (append candidates (ac-candidates-1 source)))
  (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((completion-ignore-case (or (eq ac-ignore-case t) (and (eq ac-ignore-case (quote smart)) (let ((case-fold-search nil)) (not (string-match "[[:upper:]]" ac-prefix)))))) (case-fold-search completion-ignore-case) (prefix-len (length ac-prefix)) (--cl-var-- ac-current-sources) (source nil) (candidates nil)) (while (consp --cl-var--) (setq source (car --cl-var--)) (setq candidates (append candidates (ac-candidates-1 source))) (setq --cl-var-- (cdr --cl-var--))) (progn (if (and ac-use-comphist ac-comphist) (if ac-show-menu (let* ((pair (ac-comphist-sort ac-comphist candidates prefix-len ac-comphist-threshold)) (n (car pair)) (result (ac-reduce-candidates ...)) (cons (if ... ...)) (cdr (cdr cons))) (if cons (setcdr cons nil)) (setq ac-common-part (try-completion ac-prefix result)) (setq ac-whole-common-part (try-completion ac-prefix candidates)) (if cons (setcdr cons cdr)) result) (setq candidates (ac-comphist-sort ac-comphist candidates prefix-len)) (setq ac-common-part (if candidates (popup-x-to-string (car candidates)))) (setq ac-whole-common-part (try-completion ac-prefix candidates)) candidates) (if ac-show-menu (progn (setq candidates (ac-reduce-candidates candidates)))) (setq ac-common-part (try-completion ac-prefix candidates)) (setq ac-whole-common-part ac-common-part) candidates)))
  ac-candidates()
  (setq ac-candidates (ac-candidates))
  (progn (ac-put-prefix-overlay) (setq ac-candidates (ac-candidates)) (let ((preferred-width (popup-preferred-width ac-candidates))) (if (or (null ac-menu) (>= (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (aref ac-menu 4)) preferred-width) (<= (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (aref ac-menu 4)) (- preferred-width 10)) (and (> (progn (or ... ...) (aref ac-menu 7)) 0) (ac-menu-at-wrapper-line-p))) (progn (ac-inline-hide) (ac-remove-quick-help) (ac-menu-delete) (ac-menu-create ac-point preferred-width ac-menu-height)))) (ac-update-candidates 0 0) t)
  (if (and auto-complete-mode ac-prefix (or ac-triggered force) (not isearch-mode)) (progn (ac-put-prefix-overlay) (setq ac-candidates (ac-candidates)) (let ((preferred-width (popup-preferred-width ac-candidates))) (if (or (null ac-menu) (>= (progn (or ... ...) (aref ac-menu 4)) preferred-width) (<= (progn (or ... ...) (aref ac-menu 4)) (- preferred-width 10)) (and (> (progn ... ...) 0) (ac-menu-at-wrapper-line-p))) (progn (ac-inline-hide) (ac-remove-quick-help) (ac-menu-delete) (ac-menu-create ac-point preferred-width ac-menu-height)))) (ac-update-candidates 0 0) t))
  ac-update(t)
  (setq result (ac-update force))
  (and (setq result (ac-update force)) (null ac-candidates))
  (if (and (setq result (ac-update force)) (null ac-candidates)) (progn (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def))
  (while (if (and (setq result (ac-update force)) (null ac-candidates)) (progn (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def)))
  (let (result) (while (if (and (setq result (ac-update force)) (null ac-candidates)) (progn (add-to-list (quote ac-ignoring-prefix-def) ac-current-prefix-def) (ac-start :force-init t) ac-current-prefix-def))) result)
  ac-update-greedy(t)
  (if (ac-update-greedy t) (progn (if (ac-inline-live-p) (ac-inline-hide)) (if (and (or (and (not ac-expand-on-auto-complete) (> (length ac-candidates) 1) (not menu-live)) (not (let (...) (ac-expand-common)))) ac-use-fuzzy (null ac-candidates)) (progn (ac-fuzzy-complete)))))
  (let ((menu-live (ac-menu-live-p)) (inline-live (ac-inline-live-p)) started) (ac-abort) (let ((ac-sources (or sources ac-sources))) (if (or ac-show-menu-immediately-on-auto-complete inline-live) (setq ac-show-menu t)) (setq started (ac-start :triggered triggered))) (if (ac-update-greedy t) (progn (if (ac-inline-live-p) (ac-inline-hide)) (if (and (or (and (not ac-expand-on-auto-complete) (> ... 1) (not menu-live)) (not (let ... ...))) ac-use-fuzzy (null ac-candidates)) (progn (ac-fuzzy-complete))))) started)
  (let* ((sources (car (cdr (plist-member --cl-rest-- (quote :sources))))) (triggered (car (cdr (or (plist-member --cl-rest-- (quote :triggered)) (quote (nil command))))))) (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) (quote (:sources :triggered :allow-other-keys))) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ... --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:sources :triggered)" (car --cl-keys--)))))) (let ((menu-live (ac-menu-live-p)) (inline-live (ac-inline-live-p)) started) (ac-abort) (let ((ac-sources (or sources ac-sources))) (if (or ac-show-menu-immediately-on-auto-complete inline-live) (setq ac-show-menu t)) (setq started (ac-start :triggered triggered))) (if (ac-update-greedy t) (progn (if (ac-inline-live-p) (ac-inline-hide)) (if (and (or (and ... ... ...) (not ...)) ac-use-fuzzy (null ac-candidates)) (progn (ac-fuzzy-complete))))) started))
  auto-complete-1(:sources nil)
  auto-complete()
  call-interactively(auto-complete nil nil)
  command-execute(auto-complete)

@arichiardi
Copy link

I am not an emacs expert but it looks like this happens because this line cannot find 'dict as first item in the list of candidates. At this point I don't know where to touch but commenting out the second clause solves.

@MalloZup
Copy link

MalloZup commented Aug 5, 2019

autogenerated with https://github.com/MalloZup/doghub: issue inactive since 450 days. Please update the issue or close it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants