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

Cannot connect to the `lein ring server` nrepl #309

Closed duncanjbrown closed 6 years ago

duncanjbrown commented 6 years ago

Thank you for this wonderful plugin.

The lein-ring Leiningen plugin provides a lein ring server command to run a web server. It can expose an nrepl too.

Attempting to evaluate code from fireplace while that nrepl is running results in the following error:

Error detected while processing function <SNR>86_printop[1]..<SNR>86_opfunc[35]..fireplace#client[2]..fireplace#platform[9]..fireplace#register_port_file[9]..fireplace#nrepl_connection#open[13]..fireplace#nrepl#for:
line   17:
E15: Invalid expression: \" nil]
E15: Invalid expression: \" nil]

(The error is similar to https://github.com/tpope/vim-fireplace/issues/269)

Opening a standard lein repl works ok with fireplace, though. I also noticed that when lein ring server is running I can run lein repl :connect and that is fine too.

Is there something I can do to make fireplace work better under these conditions?

Context: mac OS sierra neovim 0.2.2 vim-fireplace at 56c6ab2d7cd20f

duncanjbrown commented 6 years ago

I think this is probably not a fireplace issue.

I discovered that my global .lein/profiles.clj included the following line:

{:user {:plugins [[venantius/ultra "0.5.2"]]}}

Removing it resolved the problem. My best guess is that ultra was formatting the nrepl output in a way that fireplace did not understand. Experiments show that it formatted the output in one way when I connected to the plain lein repl nrepl, and in a different way when I connected to the lein ring server nrepl — the latter was apparently escaping quotes and newlines.

Closing with thanks for your patience...