-
-
Notifications
You must be signed in to change notification settings - Fork 649
Fix cljs type not set correctly #3282
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
Fix cljs type not set correctly #3282
Conversation
I introduced a bug with 24b9891 that made cljs repls not upgrade automatically anymore to cljs (repl-type). What actually happened was that after the init function, it was set an ultimate time, because of the "demunge" eval call I added. 1. Move the connection capability block in fron of =cider-nrepl-init-function=, this would by itself already fix it because then we would eval as clj repl and in the end once as cljs repl (which sets the repl-type see cider-repl--state-handler) 2. do not make the "demunge" eval call at all, when we already know the repl is going to be cljs (cljs or pending-cljs). (This would by itself also be a fix).
cider-connection.el
Outdated
|
||
(when cider-auto-mode | ||
(cider-enable-on-existing-clojure-buffers)) | ||
|
||
(setf cider-connection-capabilities |
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 think for the sake of readability the capabilities setting should be moved to their own function.
cider-connection.el
Outdated
(nrepl-sync-request:eval "cljs.core/demunge" (current-buffer) nil 'tooling) | ||
"value") | ||
(or | ||
cljsp |
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 think for variables it's better to use a name like is-cljs
as p
stands for predicate, which by definition is a function.
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.
ah nice
Apart from my remarks the fix seems reasonable. |
The lint CI check is failing because you've used tabs instead of spaces for indentation - please address this as well. |
I introduced a bug with 24b9891 that made cljs repls not upgrade automatically anymore to cljs (repl-type). What actually happened was that after the init function, it was set an ultimate time, because of the "demunge" eval call I added. 1. Move the connection capability block in fron of =cider-nrepl-init-function=, this would by itself already fix it because then we would eval as clj repl and in the end once as cljs repl (which sets the repl-type see cider-repl--state-handler) 2. do not make the "demunge" eval call at all, when we already know the repl is going to be cljs (cljs or pending-cljs). (This would by itself also be a fix).
wasn't sure if I should amend my commit, made a commit with the same message. |
Hi @benjamin-asdf :) I believe this change has caused a lint error, as per circle ci report: => ci/circleci: test-lint — Your tests failed on CircleCI
|
@ikappaki Indeed. Some functions will need to be shuffled around if we really need to use |
I have a new version of the function at a8b5c40 it doesn't need to user |
I introduced a bug with 24b9891
that made cljs repls not upgrade automatically anymore to cljs (repl-type).
What actually happened was that after the init function, it was set an
ultimate time, because of the "demunge" eval call I added.
Move the connection capability block in fron of
=cider-nrepl-init-function=, this would by itself already fix it
because then we would eval as clj repl and in the end once as cljs
repl (which sets the repl-type see cider-repl--state-handler)
do not make the "demunge" eval call at all, when we already know
the repl is going to be cljs (cljs or pending-cljs).
(This would by itself also be a fix).