Skip to content

cljs repl switches to previous ns after cider-repl-set-ns change followed by single eval #3503

Closed
@mrrodriguez

Description

@mrrodriguez

Expected behavior

After initializing a cider clj & cljs repl via cider-jack-in-clj&cljs I expect that after performing cider-repl-set-ns to change to some cljs namespace, the cljs repl buffer will remain in that namespace as I evaluate forms (unless it was in-ns or similar of course).

Actual behavior

After using cider-repl-set-ns to change to a new cljs ns, the cljs repl correctly is set to that ns. I can then evaluate one time within the context of that namespace and get the eval output expected. However, the cljs repl then immediately returns to the last ns prior to cider-repl-set-ns - typically cljs.user.

Steps to reproduce the problem

Using this repo https://github.com/reducecombine/fig-main and running npm install there first. Then do cider-jack-in-clj&cljs in emacs.

Go to the cljs repl buffer. use cider-repl-set-ns to change to the cljs ns vemv.fig-main. Eval any form now, eg. 1, and the ns immmediately changes back to the prior ns, which is cljs.user by default.

The eval actually does work in the correct vemv.fig-main ns context, because doing something like (multiply 2 2) correctly resolves multiply and returns 4.

Environment & Version information

Mac OS - Intel chip

CIDER version information

;; CIDER 1.8.0-snapshot (package: 20231007.628), nREPL 1.0.0
;; Clojure 1.10.0, Java 1.8.0_282

(I've tried with other Clojure versions and it doesn't matter).

Lein / Clojure CLI version

Leiningen 2.9.8

Emacs version

GNU Emacs 29.1 (build 1, x86_64-apple-darwin22.6.0, NS appkit-2299.70 Version 13.6 (Build 22G120)) of 2023-10-05

Spacemacs/emacs using emacs-plus this

(emacs v28 gave me the same results)

Operating system

OS X 13.6 "Ventura"

JDK distribution

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions