Skip to content

Support auto-cljs-build-switching #2866

Open
@enigma

Description

@enigma

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

  1. 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"]}}}

  2. Start both builds npx shadow-cljs -d watch :app :server, run node path/to/server.js and then connect Calva.

  3. Open src/app/core.cljs → evaluate form → works (build = :app).

  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cljsClojureScript-relatedrepl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions