tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Can't run omnicomplete in ClojureScript project #376

Closed hackeryarn closed 4 years ago

hackeryarn commented 4 years ago

I am using neovim and I have nREPL running. I can execute :Eval and [d just fine. When I try to get completion, however, I always get:

Error detected while processing function fireplace#omnicomplete:

E605: Exception not caught: Fireplace: no 'complete' nREPL op available (is cider-nrepl installed?)

Probably related, when I try to jump to definition using [<C-d> I get:

WARNING: No such namespace: clojure.repl, could not locate clojure/repl.cljs, clojure/repl.cljc, or JavaScript source providing "clojure.repl" at line 1 <cljs repl>
Unexpected error (ExpectionInfo) compiling at (<cljs repl>:1:525).
Unable to resolve var: special-doc in this context at line 1 <cljs repl>
tpope commented 4 years ago

is cider-nrepl installed?

You need cider-nrepl installed.

hackeryarn commented 4 years ago

It's installed. At the top of lein repl output I get:

nREPL server started on port 44189 on host 127.0.0.1 - nrepl://127.0.0.1:44189

Some commands even work like :Eval. I can also run :Connect manually with the above details and it reports no issues.

I have also used :CljEval (cider.piggieback/cljs-repl (figwheel-sidecar.repl-api/repl-env)) as suggested by https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-with-Vim. All seems to work until I try to run omnicomplete.

tpope commented 4 years ago

It still sounds like it isn't loaded correctly. That nREPL server line doesn't confirm anything about cider-nrepl.

Does completion work in plain Clojure?

hackeryarn commented 4 years ago

I think it was something with my config. It was getting picked up in by clojure but not clojurescript. After requiring it in ~/.lein/profiles.clj, it worked everywhere. Thanks for the the help and reassurance that nothing else could be the cause the issue.