-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation to embed an nREPL, specifically for Rebel Readline #285
Conversation
Rebel Readline (https://github.com/bhauman/rebel-readline) is a user-friendly REPL that goes well with vim-iced. It only has a local service, so you have to create an nREPL after it's been started. This means you have to embed an nREPL. It would be nicer to create an nREPL service in Rebel Readline, but it's too complicated! Added documentation and example 'user.clj'.
Codecov Report
@@ Coverage Diff @@
## main #285 +/- ##
==========================================
- Coverage 80.77% 78.90% -1.87%
==========================================
Files 70 73 +3
Lines 6008 6396 +388
==========================================
+ Hits 4853 5047 +194
- Misses 1155 1349 +194
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Futurile Thanks a lot!
Cound you confirm my review comments?
doc/vim-iced.txt
Outdated
https://github.com/clojure-emacs/cider-nrepl/issues/447" | ||
[] | ||
(require 'cider.nrepl) | ||
(map resolve (var-get (ns-resolve 'cider.nrepl 'cider-middleware)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cider-middleware
contains all middlewares provided from cider-nrepl.
https://github.com/clojure-emacs/cider-nrepl/blob/v0.25.4/src/cider/nrepl/middleware.clj#L7
Now track-state
middleware may lead vim-iced's hang-up. (c.f. #170)
So, to be safe, we should specify the middleware separately, as in Leiningen's example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, now that clojure-emacs/cider-nrepl#447 is fixed, this resolve
step is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the information!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liquidz My poor understanding of Clojure and cider are showing here. I believe you wanted it to specifically load the cider middleware that you have for Leiningen. I have done this - probably in the ugliest way possible.
I removed the resolve step as bbatsov suggested.
doc/vim-iced.txt
Outdated
(defn start-nrepl-server! [] | ||
(reset! | ||
nrepl-server | ||
(nrepl-server/start-server :port nrepl-port :handler (nrepl-handler)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you missing the definition of nrepl-handler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liquidz you were right, I missed it out somehow. Updated the PR.
Extraneous space. Co-authored-by: Iizuka Masashi <liquidz.uo@gmail.com>
Co-authored-by: Iizuka Masashi <liquidz.uo@gmail.com>
Co-authored-by: Iizuka Masashi <liquidz.uo@gmail.com>
Co-authored-by: Iizuka Masashi <liquidz.uo@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Futurile Thanks!
LGTM
Rebel Readline (https://github.com/bhauman/rebel-readline) is a user-friendly REPL that goes well with vim-iced. It only has a local service, so you have to create an nREPL after it's been started. This means you have to embed an nREPL.
It would be nicer to create an nREPL service in Rebel Readline, but it's too complicated!
Added documentation and example 'user.clj'.
@agriffis came up with this solution at clojure-emacs/cider-nrepl#447 (comment)