-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
There's no cider-connect-clojurescript function #1976
Comments
Makes sense to me. Probably this function should be just a combination of the existing function + setting the REPL type to ClojureScript. |
Awesome to hear!
Is there a function for this right now? (without having to fiddle with CIDER internals) |
I too am looking for a way to set the connection type to clojurescript! I often start my cljs-repl from a clj-repl. Update: by reading cider code I managed to find a way to update the buffer connection type. Would like to know if there is a better way to do it though. With the cljs-repl as active buffer:
|
I would be interested in this too; @yannvanhalewyn how do you evaluate the |
@razzmatazz |
@razzmatazz In cider mode you can still use
|
I'm happy to help with a solution here, if there's coding to be done. Something like this would be a good way to contribute.... |
@jmckitrick There's certainly a bit of coding to be done. We need two simply functions - |
(defun cider-make-cljs-repl () "Change the repl to CLJS mode." (interactive) (setq cider-repl-type "cljs")) (defun cider-connect-clojurescript () "Connect to a clojurescript repl." (interactive) (cider-connect) (cider-make-cljs-repl)) Would this do the trick? |
Actually, a simple test plan would be best. I'll try that locally, and open a PR if it works. So @vemv @yannvanhalewyn @razzmatazz if you'd add one here, I'll try it locally and tweak my 'patch' accordingly, simple though it may be. |
I'd suggest adding a more generic function - e.g. |
👍 for this feature. I'm trying to connect figwheel repl using piggieback middleware. |
So more like: (defun cider-repl-set-type [type] "REPL `type' should be either \"clj\" or \"cljs\"." (interactive "s") (setq cider-repl-type type)) (defun cider-connect-clojurescript () "Connect to a clojurescript repl." (interactive) (cider-connect) (cider-repl-set-type "cljs")) |
@bbatsov Do you want a PR or can this just be copied into someone’s existing branch? |
I've implemented this myself, as there were some nuances you hadn't taken into account (e.g. that you might not be in the right buffer when trying to set the repl type). Try what I've added in |
@yannvanhalewyn Now there's also a function in CIDER itself - |
There'a certain asymmetry given these 3 functions:
Given those 3, one could expect
cider-connect-clojurescript
to exist too. But it doesn't!The thing is, I'd like to connect to a clojurescript nrepl session started outside emacs (e.g. from a terminal,
lein figwheel
withpiggieback
middleware). This doesn't seem like an unusual need?So, if I
M-x cider-connect
and enter the nrepl address of a running clojurescipt nrepl session (started by figwheel), CIDER will connect, but autocompletions will be for clojure rather than clojurescript.IOW, cider internally is not cljs-aware when running
cider-connect
.What do you think?
Cheers - Victor
The text was updated successfully, but these errors were encountered: