-
-
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
Reconnect to the same host:port after cider-restart if the connection was established with cider-connect
#1905
Reconnect to the same host:port after cider-restart if the connection was established with cider-connect
#1905
Conversation
(buf-name (buffer-name conn))) | ||
(buf-name (buffer-name conn)) | ||
;; save these variables before we kill the connection | ||
(conn-type (with-current-buffer conn cider-connection-created-with)) |
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.
conn-type
is a bit misleading here. Maybe conn-creation-method
?
@@ -245,6 +245,10 @@ namespace-qualified function of zero arity." | |||
map) | |||
"Minibuffer keymap used for reading Clojure expressions.") | |||
|
|||
(defvar-local cider-connection-created-with 'jack-in | |||
"Save how the connection was created. Its value can be either 'jack-in or |
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.
The second sentence should be on a separate line.
(let ((default-directory project-dir)) | ||
(cider-jack-in)) | ||
(error "Can't restart CIDER connection for unknown project")))) | ||
(if (eq conn-type 'connect) |
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.
I guess you can make this a pcase
and add some error handling in case the conn-type
is unexpectedly something different than the two possible values.
It's good to have you back! I've added a few small remarks. |
Done :-) |
It's been a while since I've worked on anything in CIDER. Feels good to be back :-)
This PR fixes #1895.
@bbatsov, the approach is the same as what you outlined in the comment.
cider-connection-created-with
to track how the connection was created. It defaults to'jack-in
, and we set it to'connect
incider-connect
.cider--restart-connection
, we do the right thing based on the type ofconn
.make test
)M-x checkdoc
warningsThanks!