Fork me on GitHub
#vim
<
2022-02-01
>
timo09:02:43

I am having a problem and I don't get why it is so different now. Working with Datomic recently and I am not able to pretty print the query output somehow. It is always printed in a single long line. How do you guys do that? I am using cider-nrepl and conjure.

timo09:02:42

trying to prettyprint a set here

Olical10:02:49

:thinking_face: if you wrap it in (clojure.pprint/pprint...) does it format nicely?

Olical10:02:27

And did anything change, version-wise? The pprinting is managed by nREPL through middleware I think, although conjure specifies a flag that asks for it iirc.

Olical10:02:39

Could be some nREPL middleware shifting about?

timo12:02:53

probably...I fiddled around with nrepl-cider but it didn't solve the issue. the strange thing is that other data is properly formatted but only the datomic-query returns it onelined... :thinking_face: really odd... clojure.pprint/pprint doesn't improve it either

emilaasa13:02:40

Are you sure you're not getting a serialized value?

timo13:02:13

serialized :thinking_face: it is properly formatted and colored in the nvim-conjure-repl like this #{[#inst "2019-05-30T00:00:00.000-00:00"] [#inst "2019-04-30T00:00:00.000-00:00"] [#inst "2018-12-31T00:00:00.000-00:00"]...

emilaasa13:02:56

That does look like clojure (deserialized) values

timo13:02:24

I've had multiple entries in the vectors as well and I would have expected it to be printed out under each other to be more readable and that's actually what I get when e.g. running an http-request

#{[:trace-redirects [""]]
  [:orig-content-encoding nil]
  [:cached nil]
  [:http-client
   #object[org.apache.http.impl.client.InternalHttpClient 0x597810da "[email protected]"]]
  [:repeatable? false]
  [:chunked? false]
  [:headers
   {"Server" "nginx",
    "Age" "11",
    "Content-Type" "text/html; charset=UTF-8",
    "X-Content-Type-Options" "nosniff",
    "x-frame-options" "DENY",
    "Strict-Transport-Security" "max-age=15768000",
    "Connection" "close",
    "Accept-Ranges" "bytes",
    "Date" "Tue, 01 Feb 2022 10:32:19 GMT",
    "Vary" "X-Export-Format, X-Export-Agent, Accept-Encoding",
    "Last-Modified" "Tue, 01 Feb 2022 10:32:19 GMT",
    "X-XSS-Protection" "1; mode=block",
    "Cache-Control" "no-store"}]
  [:body
   "\n<html\n  lang=\"de\"\n  data-responsive\n    data-consentmanagement\n>\n  <head>\n    <script>performance.mark('HEAD Anfang');</script>\n    \n\n    \n\n<
  [:protocol-version {:name "HTTP", :major 1, :minor 1}]
  [:reason-phrase "OK"]
  [:request-time 506]
  [:status 200]
  [:streaming? true]
  [:length -1]}