Closed robinheghan closed 11 years ago
Which version are you using, and what corresponding configuration do you have in your emacs init files?
I using todays version on Melpa.
;; init.el
(require 'auto-complete-config) (require 'ac-nrepl) (ac-config-default) (add-hook 'cider-repl-mode-hook 'ac-nrepl-setup) (add-hook 'cider-interaction-mode-hook 'ac-nrepl-setup) (eval-after-load "auto-complete" '(add-to-list 'ac-modes 'cider-repl-mode))
(defun set-auto-complete-as-completion-at-point () (setq completion-at-point-functions '(auto-complete))) (add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point) (add-hook 'cider-repl-mode-hook 'set-auto-complete-as-completion-at-point) (add-hook 'cider-interaction-mode-hook 'set-auto-complete-as-completion-at-point)
Sometimes this can result from trying to auto-complete in a Clojure buffer which defines a namespace that has not yet been created, so you might just need to compile the file you're working on so that the namespace is fully defined.
Well, this is true for simple functions like "dec" or "defn" also :/ Btw, does this mean that I should AOT my clojure code to get auto-completion/docs?
No, but you should generally C-c C-k
your files before working in them, so if you create a new file which defines a new namespace, you should hit C-c C-k
after adding the (ns ...)
form.
So can you confirm whether doing this makes a difference in your case?
I entered my source file. Used cider-jack-in, and C-c C-k. No difference. cider-doc works just fine though
Okay, cool. That gives me more to go on. And do you get any ac-nrepl
completion results in the Clojure buffer? These would be results with the symbol "v", "c", "m", "n" or "s" on the right-hand-side of the auto-complete
dropdown?
I had a similar problem. I think it's because cider-interaction-mode
is now just cider-mode
. Some things are aliased, but dropping the 'interaction' fixed it for me.
Thanks Neale. That would make sense. I just yesterday (?) updated the suggested ac-nrepl
setup code to reflect this, because someone pointed out to me that the mode had been renamed.
Hey @bbatsov: it would probably make sense to just drop the cider-interaction-mode
alias rather than risk breakage like this, if that is indeed the cause.
@purcell Will do! I've added the aliases with the idea to avoid breakages, but oddly enough they had the opposite effect. I guess mode aliases are problematic.
Changing from cider-interaction-mode to cider-mode did the trick, thanks for all help :)
Like the title says. I only get documentation (and function arguments) when in the repl buffer, not in source code. I do get general auto-completion though.