Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Trouble with pprint #334

Open
ykessler opened this issue Apr 25, 2021 · 1 comment
Open

Trouble with pprint #334

ykessler opened this issue Apr 25, 2021 · 1 comment

Comments

@ykessler
Copy link

I'm trying to get pretty printing working but having no luck. It was working briefly when I initially turned on "Auto Pretty Print" in the settings, but a short while later pretty printing stopped working for some reason and I haven't been able to reactivate it no matter what I do. Selecting "Auto Pretty Print" in settings no longer seems to do anything, and alt-cmd-p gives me the following warnings/errors:

------ WARNING - :undeclared-ns ------------------------------------------------
 Resource: :1:31
 No such namespace: clojure.pprint, could not locate clojure/pprint.cljs, clojure/pprint.cljc, or JavaScript source providing "clojure.pprint"
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
 Resource: :1:31
 Use of undeclared Var clojure.pprint/pprint
--------------------------------------------------------------------------------
TypeError: Cannot read property 'pprint' of undefined
    at eval (eval at shadow$cljs$devtools$client$browser$global_eval (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:825:16), :4:23)
    at eval (eval at shadow$cljs$devtools$client$browser$global_eval (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:825:16), :5:3)
    at eval ()
    at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:825:16)
    at http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:834:44
    at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.env.js:141:108)
    at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:832:46)
    at shadow$cljs$devtools$client$browser$handle_message (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:917:37)
    at http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.env.js:289:151
    at Object.shadow$cljs$devtools$client$env$process_next_BANG_ [as process_next_BANG_] (http://localhost:3000/js/cljs-runtime/shadow.cljs.devtools.client.env.js:268:90)

I also set the following in my shadow-cljs.edn file, based on their guide (though it wasn't necessary before) but still no such luck:

:devtools
        {:repl-pprint true}

I'm new to shadow-cljs/REPL development so excuse my ignorance. Any help would be appreciated.

@ykessler
Copy link
Author

Hmm - turns out the REPL is pretty printing when the map is long enough:

For example, this doesn't pretty print:

(identity {:aaa "aaa", :bbb "bbb", :ccc "ccc", :ddd "ddd", :eee "eee"})

but this does:

(identity {:aaa "aaa", :bbb "bbb", :ccc "ccc", :ddd "ddd", :eee "eee", :fff "fff"})

And still not sure why I'm getting errors with alt-cmd-p

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant