-
-
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
ns-form sent within cider-eval-defun-at-point seems incomplete #1026
Comments
The contents of |
Contents of
|
This might be nrepl/weasel#48. Will investigate this evening. Do you still get the issue if you do |
Yes, problem stays the same:
|
@swannodette quick question - feel free to ignore surrounding context of the CIDER issue - should repeated applications of For example, in a normal Clojure REPL I can do: user=> (ns my-test-ns.core (:require [clojure.string :as string]))
nil
my-test-ns.core=> (def a string/blank?)
#'my-test-ns.core/a
my-test-ns.core=> (ns my-test-ns.core)
nil
my-test-ns.core=> (def a string/blank?)
#'my-test-ns.core/a
my-test-ns.core=> But in a Node REPL (using quick start guide and ClojureScript:cljs.user> (ns my-test-ns.core (:require [clojure.string :as string]))
true
ClojureScript:my-test-ns.core> (def a string/blank?)
#<function clojure$string$blank_QMARK_(s){
return goog.string.isEmptySafe(s);
}>
ClojureScript:my-test-ns.core> (ns my-test-ns.core)
nil
ClojureScript:my-test-ns.core> (def a string/blank?)
WARNING: No such namespace: string, could not locate string.cljs at line 1 <cljs repl>
WARNING: Use of undeclared Var string/blank? at line 1 <cljs repl>
repl:13
throw e__3919__auto__;
^
ReferenceError: string is not defined
at repl:1:109
at repl:9:3
at repl:14:4
at Object.exports.runInThisContext (vm.js:74:17)
at Domain.<anonymous> ([stdin]:41:34)
at Domain.run (domain.js:197:16)
at Socket.<anonymous> ([stdin]:40:25)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
ClojureScript:my-test-ns.core> |
@cichli probably best to simulate the Clojure behavior if we can. Feel free to open a JIRA issue. Thanks. |
@swannodette thanks for the quick response, logged as CLJS-1139. |
@cichli Ah, another difference between Clojure and ClojureScript that I wasn't aware of. The current solution you proposed is sound. |
That's not the actual reason for the truncation - that's the reason for the caching. The reason for the truncation is that if the ns hasn't changed since it was cached we don't need the whole form. |
... and we don't use the whole form in order to speed up CS. As far as I recall there were no other reasons not to use the full form. Before we were perfectly happy with evaluating full ns every time. |
Thanks! |
ClojureScript project is https://github.com/friemen/zackzack
After starting a REPL using
cider-jack-in
I start the backend and the weasel+piggieback based browser-connected REPL.Then I connect with the browser using http://localhost:8080/testindex.html
I load for example src/cljs/zackzack/demo/playground.cljs
I eval code using
cider-eval-defun-at-point
for example functionplayground-view
.I receive warnings as shown below and changed code is not loaded/compiled:
I added
(message ns-form)
in cider-interaction.el, functioncider--dummy-file-contents
.In Messages buffer the line
(ns zackzack.demo.playground)
appears, but the complete ns-form in cljs file is:I suspect the ns-form sent to compiler is incomplete, which causes the warnings.
Around end of November 2014 this worked flawlessly, so the problem appeared very recently.
Oh, and not to forget: I really appreciate all the excellent work that you have done for the Emacs/Clojure community!
The text was updated successfully, but these errors were encountered: