Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No reader function for tag object" when formatting EDN buffer #722

Closed
orestis opened this issue Mar 3, 2020 · 2 comments · Fixed by #723
Closed

"No reader function for tag object" when formatting EDN buffer #722

orestis opened this issue Mar 3, 2020 · 2 comments · Fixed by #723
Assignees

Comments

@orestis
Copy link

orestis commented Mar 3, 2020

I have an EDN buffer which is huge long line and I'd like to pretty-print it with indentation etc.

I tried cider-format-edn-buffer and got this Exception {:type :reader-exception, :ex-kind :reader-error}. This probably because the EDN looks like:

#object[next.jdbc.connection$url_PLUS_etc$reify__28723 0x14570829 "jdbc:postgresql://my-database.com:5432/"]

I would expect though that the formatter wouldn't care to actually read the EDN (it could pass through any unknown tags, right?)

Cider version is 0.24.0

Thanks!

@vemv vemv transferred this issue from clojure-emacs/cider Oct 5, 2021
@vemv
Copy link
Member

vemv commented Oct 5, 2021

The code in question is:

(defn- format-edn
[edn print-fn]
(->> (read-edn edn)
(map (fn [value]
(let [writer (StringWriter.)]
(print-fn value writer)
(str writer))))
(str/join "\n")
(str/trim)))

Maybe the #object tag handler can be temporarily bound?

@vemv
Copy link
Member

vemv commented Dec 7, 2021

Released in [cider/cider-nrepl "0.27.3"]!

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

Successfully merging a pull request may close this issue.

2 participants