-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I'm not completely sure about why this happens like it does, but jotting down my thoughts so maybe we can figure it out together.
Some background:
- When Calva connects to a ClojureScript REPL it will first connect to the Clojure REPL and establish an nREPL session. Then it clones this session and ”promotes” the clone to a ClojureScript nREPL session. Note that we now have two CLJ sessions:
CLJ1while be used for Clojure files, andCLJ2(promoted toCLJS) will be used or ClojureScript files. - Calva also has a
CLJCsession ”pointer” which will point toCLJ1by. default. (This pointer can be toggled by the user by clicking thecljc/cljbutton in the statusbar.)
When you load example.cljc it will compile the macro in CLJ1. Then when you load core.cljs it will compile the macro using CLJ2. Then you update the file and recompile the macro in CLJ1 by loading example.cljc. Then you load core.cljs which doesn't seem to recompile the macro. I don't know why.
I tried this: I toggled the CLJC pointer to be cljc/cljs and then I get the expected results loading files in the order
example.cljc(recompiles the macro usingCLJ2)core.cljs
But if I load core.cljs first the recompile doesn't happen.
So, maybe it is generally the case that loading a .cljs file does not trigger a recompile of macros... This could be a Calva bug, but I don't recall any code in Calva that cares about wether a file is .cljc or .cljs. It just has this mapping of file-extension -> nrepl-session and sends the nREPL op to the session it picks up.
I'll investigate it a bit further and see what I can figure out.