You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to add custom printing to my user type in ClojureScript. Evaluating a value with custom print has weird behavior, when done inside CIDER + Shadow-CLJS. If I run a plain Shadow-CLJS REPL then it just works. Also I've heard that a plain REPL also works. Therefore, I think my problem has something to do with CIDER, in how it "prints a value".
It would also help me, if you can confirm or deny the problem in a plain CLJS project with Shadow-CLJS, with "jacked-in" CIDER. Perhaps it is my user error.
A custom IPrintWithWriter (standard CLJS) can be defined for a type and the custom printed value is used by CIDER when showing a value without problem.
You should see in the following example this should print.
Actual behavior
It seems like the printing is cut at the first space since CIDER only shows this. Also special characters # and [] seem to be acting weird. Perhaps there is some kind of an encoding problem or missing escaping somewhere.
Hey,
I've been trying to add custom printing to my user type in ClojureScript. Evaluating a value with custom print has weird behavior, when done inside CIDER + Shadow-CLJS. If I run a plain Shadow-CLJS REPL then it just works. Also I've heard that a plain REPL also works. Therefore, I think my problem has something to do with CIDER, in how it "prints a value".
It would also help me, if you can confirm or deny the problem in a plain CLJS project with Shadow-CLJS, with "jacked-in" CIDER. Perhaps it is my user error.
See also discussion https://clojurians.slack.com/archives/C0617A8PQ/p1725863915225369
Expected behavior
A custom
IPrintWithWriter
(standard CLJS) can be defined for a type and the custom printed value is used by CIDER when showing a value without problem.You should see in the following example
this should print
.Actual behavior
It seems like the printing is cut at the first space since CIDER only shows
this
. Also special characters#
and[]
seem to be acting weird. Perhaps there is some kind of an encoding problem or missing escaping somewhere.Steps to reproduce the problem
Define the type (in e.g., REPL)
Then evaluate to return a value of it:
> (TestType.) this
NB. This works:
Environment & Version information
CIDER version information
Tested with two nREPL versions.
CIDER 1.15.1 (Cogne), nREPL 1.3.0
Clojure 1.11.1, Java 17.0.12
CIDER 1.15.1 (Cogne), nREPL 1.2.0
Clojure 1.11.1, Java 17.0.12
Lein / Clojure CLI version
Leiningen 2.9.8 on Java 17.0.12 OpenJDK 64-Bit Server VM
Emacs version
GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2024-06-25, modified by Debian
Operating system
Linux beta 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
JDK distribution
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment (build 17.0.12+7-Debian-2deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.12+7-Debian-2deb12u1, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: