Skip to content

Could be a Calva issue #1

@PEZ

Description

@PEZ

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:

  1. 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: CLJ1 while be used for Clojure files, and CLJ2 (promoted to CLJS) will be used or ClojureScript files.
  2. Calva also has a CLJC session ”pointer” which will point to CLJ1 by. default. (This pointer can be toggled by the user by clicking the cljc/clj button 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

  1. example.cljc (recompiles the macro using CLJ2)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions