Description
Calva currently lets me manually switch between two running shadow-cljs builds (:app for the browser, :server for a Node-based service) via the status-bar toggle or by evaluating but it does not change the active build automatically when I jump between files that belong to different builds. Unlike what happens with clj projects.
Reproduction steps
-
Create a single shadow-cljs.edn with two builds:
{:builds {:app {:target :browser :source-paths ["src/app"]}
:server {:target :node-script :source-paths ["src/server"]}}} -
Start both builds
npx shadow-cljs -d watch :app :server
, runnode path/to/server.js
and then connect Calva. -
Open src/app/core.cljs → evaluate form → works (build = :app).
-
Open src/server/core.cljs → evaluate form → either fail or will print in the
:app
repl because it's still connected to the:app
repl.
If you manually switch to :server
it will print on the node ...
terminal.
Expected behaviour
Calva should automatically switch the active shadow-cljs build (and thus the CLJS REPL it clones) based on the file I am editing—ideally by matching the file’s path to the :source-paths configured for each build.
Actual behaviour
The build remains whatever was last selected; manual switching is required each time.
Why it matters
See discussion at https://clojurians.slack.com/archives/CBE668G4R/p1750499391908279